public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11569] New: there's no substitute for #pragma once
@ 2003-07-18  9:33 from-bugzilla at geek-central dot gen dot nz
  2003-07-18 13:39 ` [Bug c++/11569] " pinskia at physics dot uc dot edu
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: from-bugzilla at geek-central dot gen dot nz @ 2003-07-18  9:33 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11569

           Summary: there's no substitute for #pragma once
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: from-bugzilla at geek-central dot gen dot nz
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

#pragma once used in a .h file indicates that it is only to be parsed once, 
even if it is (directly or indirectly) included multiple times in the same 
source file. However, every time you use this pragma, you get a warning 
saying it is "obsolete", and there seems to be no compiler option to turnoff 
this warning.

I believe there is some kind of recommendation that one should bracket 
the contents of the .h file with something like

#ifndef 
_SOME_ARBITRARY_SYMBOL_CONSTRUCTED_FROM_FILE_NAME_
#define 
_SOME_ARBITRARY_SYMBOL_CONSTRUCTED_FROM_FILE_NAME_

...

#endif

and gcc will "do the right thing". Now, "doing the right thing" is all very well 
where it saves you doing extra work, but where it makes you go out of your 
way to write something much more verbose than the obvious thing, as in 
this case, it just seems to me to be brain-dead.

Conclusion: please provide some way to turn off the warning about 
#pragma once being "obsolete".

Thank you.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-07-29 22:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18  9:33 [Bug c++/11569] New: there's no substitute for #pragma once from-bugzilla at geek-central dot gen dot nz
2003-07-18 13:39 ` [Bug c++/11569] " pinskia at physics dot uc dot edu
2003-07-18 13:58 ` bangerth at dealii dot org
2003-07-22  6:53 ` from-bugzilla at geek-central dot gen dot nz
2003-07-22 11:49 ` pinskia at physics dot uc dot edu
2003-07-22 13:58 ` pinskia at physics dot uc dot edu
2003-07-22 14:00 ` bangerth at dealii dot org
2003-07-23  4:37 ` from-bugzilla at geek-central dot gen dot nz
2003-07-23  4:54 ` from-bugzilla at geek-central dot gen dot nz
2003-07-23 14:21 ` bangerth at dealii dot org
2003-07-29 22:08 ` neil at gcc dot gnu dot org
2003-07-29 22:09 ` [Bug preprocessor/11569] " neil at gcc dot gnu dot org
2003-07-29 22:29 ` neil at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).