home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:18749 comp.unix.bsd:10508
- Path: sparky!uunet!dtix!darwin.sura.net!bogus.sura.net!pandora.pix.com!stripes
- From: stripes@pix.com (Josh Osborne)
- Newsgroups: comp.lang.c,comp.unix.bsd
- Subject: Re: Segmentation faults
- Message-ID: <BzMFF4.Aut@pix.com>
- Date: 21 Dec 92 18:01:51 GMT
- References: <1gricmINNsl@ub.d.umn.edu> <1992Dec18.134225.20548@Logix.DE> <veit.724925472@du9ds3>
- Sender: news@pix.com (The News Subsystem)
- Organization: Pix Technologies -- The company with no adult supervision
- Lines: 22
- Nntp-Posting-Host: pandora.pix.com
-
- In article <veit.724925472@du9ds3> veit@du9ds3.fb9dv.uni-duisburg.de writes:
- [...]
- >This is a real problem where sizeof(int) != sizeof(char*), for instance with
- >Turbo C or Microsoft C or similar 16bit junk. But if you compile this
- >with a 32bit K&R compiler, and sizeof(int)==sizeof(char*) (=4), it won't see
- >a difference, because it will just take 32bit from the parameter stack
- >and push it as a 32bit argument to printf.
-
- (which masks many bugs, which will show up on, say the Alpha)
-
- >The compiler cannot find out the real expected type (it cannot do parsing
- >of the format string in general!).
-
- Not in general, but gcc CAN verify printf/scanf style args and parms as
- long as the format string is a constant. See __attribute__ in the gcc
- manual.
- --
- stripes@pix.com "Security for Unix is like
- Josh_Osborne@Real_World,The Multitasking for MS-DOS"
- "The dyslexic porgramer" - Kevin Lockwood
- We all agree on the necessity of compromise. We just can't agree on
- when it's necessary to compromise. - Larry Wall
-