home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!tarzan!tt
- From: tt@tarzan.jyu.fi (Tapani Tarvainen)
- Subject: cc -N bug?
- Message-ID: <TT.92Nov17151405@tarzan.jyu.fi>
- Originator: tt@tarzan.math.jyu.fi
- Sender: news@jyu.fi (News articles)
- Nntp-Posting-Host: tarzan.math.jyu.fi
- Organization: University of Jyvaskyla
- Date: Tue, 17 Nov 1992 13:14:05 GMT
- Lines: 39
-
- When I compile the appended little program (it's byteorder.c from
- recent tripwire distribution) in our HP9000/720 running HP-UX 8.07
- with the command "cc -N -Wl,-a,archive" it compiles without complaints
- (except one "warning 951: Shift of 32 bits or more.") and produces a
- normal-looking executable ('file' confirms it's "PA-RISC1.1 executable
- -not stripped"), but when I try to execute it, I get "cannot execute"
- -- or if use sh, I get "syntax error at line 1: `8AT^AP^G^Bªq^P^D'
- unexpected" as if it thinks it is a shell script. Without the -N
- option it works fine. And the problem doesn't occur in a 9000/425e.
- Have I done something stupid or is there a bug in the compiler or what?
-
- The compiler versio (by what) is "HP92453-01 A.08.71 HP C Compiler".
-
-
- main()
- {
- int i;
- union {
- unsigned long l;
- char c[sizeof(long)];
- } u;
-
- if (sizeof(long) > 4)
- u.l = (0x08070605L << 32) | 0x04030201L;
- else
- u.l = 0x04030201L;
-
- (void)printf("#define BYTEORDER 0x");
- for (i=0; i < sizeof(long); i++)
- (void)printf("%c",u.c[i]+'0');
- (void)printf("\n");
-
- exit(0);
- /*NOTREACHED*/
- }
-
-
- --
- Tapani Tarvainen (tt@math.jyu.fi, tarvainen@finjyu.bitnet)
-