home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.xenix.sco
- Path: sparky!uunet!cs.utexas.edu!torn!utzoo!telly!druid!pseudo!mjn
- From: mjn@pseudo.uucp (Murray Nesbitt)
- Subject: Re: dirent and strerror problems in SCO XENIX 2.3?
- Organization: Private system in Toronto, ON
- Date: Sun, 26 Jul 1992 07:07:35 GMT
- Message-ID: <MJN.92Jul25230735@pseudo.uucp>
- In-Reply-To: alan@ahmcs.mq.com's message of 24 Jul 92 06:40:31 GMT
- References: <466@ahmcs.mq.com>
- Sender: mjn@pseudo.uucp (Murray Nesbitt)
- Lines: 29
-
-
- In article <466@ahmcs.mq.com> alan@ahmcs.mq.com (Alan Mintz) writes:
-
- > Also, has anyone had trouble with the strerror macro in string.h under
- > gcc? I get unexplainable "parse errors" when using it, yet, in looking
- > at the output of cpp, all looks normal. What am I missing?
-
- Look more closely at the output of cpp.
-
- This is how the macro strerror() is defined in my original string.h
- (Xenix 2.3.2):
-
- #define strerror(err) (sys_errlist[err]);
-
- Notice the semi-colon at the end. Obviously, this causes problems
- when you invoke the macro in statements like this:
-
- fprintf( stderr, "You lose: %s\n", strerror(errno) );
-
- as it expands to
-
- fprintf( stderr, "You lose: %s\n", (sys_errlist[errno]); );
-
- Delete the trailing semi from string.h (or have your sysadmin do it),
- and you shouldn't get bitten by this one again.
-
- Murray
- --
- Until my site's in the maps, please reply to "druid!pseudo!mjn".
-