FW: Preprocessor directive #pragma once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Kankaria, Abhijit (TS USA) 
Sent: Wednesday, June 08, 2005 9:17 AM
To: 'gcc-help@xxxxxxxxxxx'
Subject: Preprocessor directive #pragma once

Hi,

I am using the gcc 3.4.2 compiler on Solaris 8 to compile CPP code.

I am porting the code from windows to Solaris and have the #pragma once used all over in the code.
It seems like the #pragma once is not working on Solaris because I get the error messages like "multiple definition" OR "conflicts with previous declaration", the reason being headers are included multiple times in the same .cpp file.

The bug 11536 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11569) indicates the #pragma once has been undeprecated in 3.4 because it contains a correct
implementation.

Could you please verify if this is fixed and working or there is any thing additional I need to do to use this directive on Solaris or do I need to use a different version of compiler.

Solaris Version:
----------------
cat /etc/release
                       Solaris 8 2/02 s28s_u7wos_08a SPARC
           Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
                           Assembled 18 December 2001

GCC Version:
------------
gcc --v
Reading specs from /../../gcc/sparc-sun-solaris2.8/3.4.2/specs
Configured with: /../../gcc-3.4.2/configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls --disable-libgcj --enable-languages=c,c++,objc --build=sparc-sun-solaris2.8 --prefix=/../../local --enable-mpfr --enable-shared
Thread model: posix
gcc version 3.4.2


Thanks,
- Abhijit.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux