Bug 47823

Summary: #pragma once is documented in a weird spot
Product: gcc Reporter: Olaf van der Spek <olafvdspek>
Component: preprocessorAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: minor Keywords: documentation
Priority: P3    
Version: 4.5.2   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2012-01-28 00:00:00

Description Olaf van der Spek 2011-02-20 15:14:25 UTC
#pragma once appears to be undocumented

http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Pragmas.html
Comment 1 Andrew Pinski 2011-02-20 20:40:03 UTC
At one point it was documented in the C preprocessor manual but it is no longer documented there.
Comment 2 Andrew Pinski 2012-01-28 19:01:42 UTC
Confirmed really it is documented but just under #import documentation.  It really should be under its own:
Another way to prevent a header file from being included more than once
is with the @samp{#pragma once} directive.  If @samp{#pragma once} is
seen when scanning a header file, that file will never be read again, no
matter what.

@samp{#pragma once} does not have the problems that @samp{#import} does,
but it is not recognized by all preprocessors, so you cannot rely on it
in a portable program.