Article View: comp.unix.programmer
Article #3675Re: gcc -O2 bug
From: Preston F. Crow
Date: Sat, 10 Aug 1996 00:00
Date: Sat, 10 Aug 1996 00:00
23 lines
1782 bytes
1782 bytes
Christopher R Volpe <volpe@ash.crd.ge.com> writes: >comp.std.c answer: The compiler is allowed to know the semantics of >printf, and should know that the printf function will not modify >flag_pt, despite the fact that other user-defined functions could. No, the compiler can't assume anything about printf(), as the user could have stupidly defined his own function of the same name, overriding the expected behaviour of the version in libc. In some of my Mach programming, I've done just that. [Well, with different functions, where the normal version had problems, but still...] Never expect a compiler to be smart, but always be prepared for it to outsmart you. --PC -- We're sorry, the .sig you have selected has been deleted or is no longer in service. If you think you have read this .sig in error, please disconnect and try your news reader again. Thank-you.
Technical Details
Message-ID:
<4uh4vh$aj2@dartvax.dartmouth.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<4ubnat$75u@freeside.fc.net> <danpop.839504721@news.cern.ch> <vkohklaizj.fsf@atari.connectinc.com> <4udd3i$90k@solutions.solon.com> <vkn3059yhu.fsf@atari.connectinc.com> <320B6599.2C8E@ash.crd.ge.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,7d30cae02ba9b089 X-Google-Attributes: gid11318c,public X-Google-Thread: 10c696,7d30cae02ba9b089 X-Google-Attributes: gid10c696,public X-Google-Thread: fc89c,7d30cae02ba9b089 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,7d30cae02ba9b089 X-Google-Attributes: gid1014db,public From: crow@coos.dartmouth.edu (Preston F. Crow) Subject: Re: gcc -O2 bug Date: 1996/08/10 Message-ID: <4uh4vh$aj2@dartvax.dartmouth.edu> X-Deja-AN: 173279985 references: <4ubnat$75u@freeside.fc.net> <danpop.839504721@news.cern.ch> <vkohklaizj.fsf@atari.connectinc.com> <4udd3i$90k@solutions.solon.com> <vkn3059yhu.fsf@atari.connectinc.com> <320B6599.2C8E@ash.crd.ge.com> organization: Dartmouth College, Hanover, NH, USA newsgroups: comp.unix.programmer,gnu.gcc.help,comp.os.linux.development.apps,comp.lang.c