🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3656

Re: gcc -O2 bug

#3656
From: Alan Lehotsky
Date: Wed, 14 Aug 1996 00:00
47 lines
2652 bytes
In article <4uo8it$ogu@dartvax.dartmouth.edu>, crow@coos.dartmouth.edu
(Preston F. Crow) wrote:

>>>Christopher R Volpe <volpe@ash.crd.ge.com> writes:
>>>>Preston F. Crow wrote:
>>>>> 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
>>>
>>>>Bzzzt. Thanks for playing.

  1/ You should be able to turn this behavior off with

      -fno-builtins

  2/ ANSI says (4.1.2.1)

      ...If the program declares or defines an identifier with the
      same name as an identifier reserved in that context (other than
      allowed by 4.1.6) the behavior is undefined.

     The 'that context' refers to reserved identifiers declared in the
     library header files.

So, my interpretation is that:

   a. RTFM (or RTF info-files, in the case of gcc), and you can
      dumb-down the compiler.

   b. ANSI allows a compiler to do strange and wonderous things to
      recognize those names provided by the standard library header
      files.

-- Al Lehotsky

-- 
                    Quality Software Management
                  (617)862-5418 (617)674-1096 FAX
                        lehotsky@tiac.net
                 http://www.tiac.net/users/lehotsky
                   Software Process Improvement
                      Management Consulting
Technical Details
Message-ID: <lehotsky-1408962247310001@news.tiac.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
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> <4uh4vh$aj2@dartvax.dartmouth.edu> <320F47BA.39E9@ash.crd.ge.com> <4uo8it$ogu@dartvax.dartmouth.edu>

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: lehotsky@tiac.net (Alan Lehotsky)
Subject: Re: gcc -O2 bug
Date: 1996/08/14
Message-ID: <lehotsky-1408962247310001@news.tiac.net>
X-Deja-AN: 174262518
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> <4uh4vh$aj2@dartvax.dartmouth.edu> <320F47BA.39E9@ash.crd.ge.com> <4uo8it$ogu@dartvax.dartmouth.edu>
content-type: text/plain; charset=ISO-8859-1
organization: Quality Software Management
mime-version: 1.0
newsgroups: comp.unix.programmer,gnu.gcc.help,comp.os.linux.development.apps,comp.lang.c