🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2385

shadowing and macros and warnings.

#2385
From: Richard M. STALLMAN
Date: Sat, 11 Mar 1989 16:33
12 lines
1015 bytes
If macros are written in the safest known way:
#define foo(a) ({ int __foo_a = (a); ... })
then as long as foo itself does not contain an accidental conflict
then there is no danger of causing one by using foo.
However, any use of the form foo (foo (a)) will result
in harmless shadowing of the internal variable __foo_a.

I think warnings about shadowing are a bad idea unless we
can recommend a generally applicable reasonable practice
which avoids provoking the warning.  It is a pain in the ass
to get a warning for something which does not have anything
wrong with it.
Technical Details
Message-ID: <8903111633.AA12072@litp.univ-p6-7.fr>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!litp!rms

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!litp!rms
From: mcvax!litp!rms@UUNET.UU.NET (Richard M. STALLMAN)
Newsgroups: gnu.gcc.bug
Subject: shadowing and macros and warnings.
Message-ID: <8903111633.AA12072@litp.univ-p6-7.fr>
Date: 11 Mar 89 16:33:41 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: rms@wheaties.ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 12