home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!jamie
- From: jamie@cdevil.unx.sas.com (James Cooper)
- Subject: Re: wierd sas/c bug
- Originator: jamie@cdevil.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BzMMqI.CM1@unx.sas.com>
- Date: Mon, 21 Dec 1992 20:39:53 GMT
- References: <BzIw0y.n31@ccu.umanitoba.ca> <BzM6F7.E6K@unx.sas.com> <BzMGn8.370@ccu.umanitoba.ca>
- Nntp-Posting-Host: cdevil.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 41
-
-
- In article <BzMGn8.370@ccu.umanitoba.ca>, umfehr06@ccu.umanitoba.ca (John Fehr) writes:
- >In <BzM6F7.E6K@unx.sas.com> walker@twix.unx.sas.com (Doug Walker) writes:
- >>Please post a COMPILABLE example. I can virtually guarantee that this
- >>is not a compiler bug. A compiler that broken would not compile
- >
- >OK... here's a compilable example: (hopefully I'll type it in right this
- >time. :)
- >
- >#include <stdio.h>
- >#undef WHATEVER "test"
- >
- >char dummy[100]="another test";
- >
- >main() {
- > printf("dummy='%s'\n",dummy);
- >}
- >
- >That SHOULD (it does for me) print out something totally unexpected.
- >What's almost as wierd, is if you #include something after the
- >#undef. (an empy .h file will do)
- >I know that #undef WHATEVER "test" isn't ANSI-compliant (the HP-compiler
- >complanes about it anyway) but some programs actually have that in
- >their code.
-
- Wow... good one! How about an official EMITS report, just to make us happy! :-)
-
- It appears the first "test" is getting merged with the "another test" string,
- per ANSI concatenation rules, such that you get:
-
- dummy = 'testanother test'
-
- when you compile and run this sample program... wierd!
-
- --
- ---------------
- Jim Cooper
- (jamie@unx.sas.com) bix: jcooper
-
- Any opinions expressed herein are mine (Mine, all mine! Ha, ha, ha!),
- and not necessarily those of my employer.
-