Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: danpop@mail.cern.ch (Dan Pop)
Subject: Re: Compiler flags of dubious utility.
Date: 1995/12/12	[thread overview]
Message-ID: <danpop.818778812@rscernix> (raw)
In-Reply-To: 4aih5k$m1l@topaz.sensor.com

In <4aih5k$m1l@topaz.sensor.com> ron@topaz.sensor.com (Ron Natalie) writes:

>We've been running our application on the AXP (UNIX) for several years
                                                      ^^^^^^^^^^^^^^^^^
Couldn't be more than 3 :-)

>and we came accross something we thought had promise, a flag on the
>compiler to use 32 bit pointers.  We want to do this not because we
>are lazy, but because it's a waste of memory (and we do a lot of pointers).
>
>Well as soon as we finished the build and our code segv'd we realized
>the folly.  Despite the fact that you can build 32bit applications,
>there is no 32-bit compiled version of system libraries (or am I missing
>something).

Apparently, you're missing -taso at link time.  If you do everything as
documented in the man page, the system libraries work with your 32-bit
pointers:

    ues5:~/tmp 11> cat test.c
    #include <stdio.h>

    int main()
    {
    char *msg = "Hello, world!";
    printf("%ld\n", (long)sizeof msg);
    puts(msg);
    return 0;
    }
    ues5:~/tmp 12> cc -c -xtaso_short test.c
    ues5:~/tmp 13> cc -taso test.o
    ues5:~/tmp 14> ./a.out 
    4
    Hello, world!
    ues5:~/tmp 15> cc test.o
    ues5:~/tmp 16> ./a.out 
    4
    Segmentation fault (core dumped)

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



  reply	other threads:[~1995-12-12  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-12-12  5:00 Compiler flags of dubious utility Ron Natalie
1995-12-12  5:00 ` Dan Pop [this message]
1995-12-12  5:00   ` Ron Natalie
1995-12-12  5:00     ` Ron Natalie
1995-12-15  5:00       ` Jeffrey Mogul
1995-12-15  5:00         ` Dan Pop
1995-12-15  5:00         ` Dan Pop
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox