* #ident query
@ 2004-12-22 7:39 Barry Clarkson
2004-12-22 8:02 ` Ken Foskey
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Barry Clarkson @ 2004-12-22 7:39 UTC (permalink / raw)
To: gcc-help
Hi,
I'm in the process of porting some code to a Linux
based platform that is using gcc 3.2.2. I am trying
to enforce ansi C (as near as possible!) but there are
#ident directives within the code for third party
source control. What can I modify within the source
(not ideal) or on the command line to get ansi C and
safely ignore the '#ident' directives (tried
-fno-ident)?
Thanks in advance,
Barry
GCC version...
$ gcc -v
Reading specs from
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix
--disable-checking --with-system-zlib
--enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Command line...
gcc -c -g -ansi -std=c99 -pedantic-errors -Wall
-Wundef -Wshadow -Wunreachable-code -Wno-long-long
-Werror -fno-ident -I../inc -I../proto aps_log_err.c
-o ../obj/aps_log_err.o
aps_log_err.c:31:2: #ident is a GCC extension
Example #ident...
#ident "@(#) SCCS aps_log_err.c 1.7 - 04/10/13
14:02:54"
___________________________________________________________
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: #ident query
2004-12-22 7:39 #ident query Barry Clarkson
@ 2004-12-22 8:02 ` Ken Foskey
2004-12-22 12:32 ` Eljay Love-Jensen
2004-12-22 15:50 ` Ian Lance Taylor
2 siblings, 0 replies; 5+ messages in thread
From: Ken Foskey @ 2004-12-22 8:02 UTC (permalink / raw)
To: gcc help
On Wed, 2004-12-22 at 07:38 +0000, Barry Clarkson wrote:
> Hi,
>
> I'm in the process of porting some code to a Linux
> based platform that is using gcc 3.2.2. I am trying
> to enforce ansi C (as near as possible!) but there are
> #ident directives within the code for third party
> source control. What can I modify within the source
> (not ideal) or on the command line to get ansi C and
> safely ignore the '#ident' directives (tried
> -fno-ident)?
>
Simple.
/*
#ident "@(#) SCCS aps_log_err.c 1.7 - 04/10/13 14:02:54"
*/
--
Ken Foskey
OpenOffice.org developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: #ident query
2004-12-22 7:39 #ident query Barry Clarkson
2004-12-22 8:02 ` Ken Foskey
@ 2004-12-22 12:32 ` Eljay Love-Jensen
2004-12-22 15:50 ` Ian Lance Taylor
2 siblings, 0 replies; 5+ messages in thread
From: Eljay Love-Jensen @ 2004-12-22 12:32 UTC (permalink / raw)
To: Barry Clarkson, gcc-help
Hi Barry,
You could pre-process the source file to remove the offending #ident lines
before compiling.
This will remove the line entirely...
grep -v -e '^#ident' source.c >source.c1
gcc -pedantic -W -Wall -o source.o -x c source.c1
Or this will replace the line with a blank line...
sed -e 's/^#ident.*$//' source.c >source.c1
gcc -pedantic -W -Wall -o source.o -x c source.c1
HTH,
--Eljay
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: #ident query
2004-12-22 7:39 #ident query Barry Clarkson
2004-12-22 8:02 ` Ken Foskey
2004-12-22 12:32 ` Eljay Love-Jensen
@ 2004-12-22 15:50 ` Ian Lance Taylor
2 siblings, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2004-12-22 15:50 UTC (permalink / raw)
To: Barry Clarkson; +Cc: gcc-help
Barry Clarkson <cheekyscamp@yahoo.co.uk> writes:
> I'm in the process of porting some code to a Linux
> based platform that is using gcc 3.2.2. I am trying
> to enforce ansi C (as near as possible!) but there are
> #ident directives within the code for third party
> source control. What can I modify within the source
> (not ideal) or on the command line to get ansi C and
> safely ignore the '#ident' directives (tried
> -fno-ident)?
The only way to modify the command line would be to remove
-pedantic-errors. If you use -pedantic-errors, you are asking to
compiler to give you an error for anything which is pedantically
incorrect. #ident is pedantically incorrect. There is no option for
"all pedantic errors except this particular one."
If you insist on -pedantic-errors, then you need to modify the source
code to remove the #ident directives.
Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* #ident query
@ 2004-12-20 11:03 Barry Clarkson
0 siblings, 0 replies; 5+ messages in thread
From: Barry Clarkson @ 2004-12-20 11:03 UTC (permalink / raw)
To: 'gcc-help@gcc.gnu.org'
Hi,
I'm in the process of porting some code to a Linux based platform that is
using gcc 3.2.2. I am trying to enforce ansi C (as near as possible!) but
there are #ident directives within the code for third party source control.
What can I modify within the source (not ideal) or on the command line to
get ansi C and safely ignore the '#ident' directives (tried -fno-ident)?
Thanks in advance,
Barry
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
gcc -c -g -ansi -std=c99 -pedantic-errors -Wall -Wundef -Wshadow
-Wunreachable-code -Wno-long-long -Werror -fno-ident -I../inc -I../proto
aps_log_err.c -o ../obj/aps_log_err.o
aps_log_err.c:31:2: #ident is a GCC extension
#ident "@(#) SCCS aps_log_err.c 1.7 - 04/10/13 14:02:54"
The content of this e-mail and any attachment is private and may be legally
privileged. If you are not
the intended recipient, any use, disclosure, copying or forwarding of this
e-mail and/or its
attachments is unauthorised. If you have received this e-mail in error
please notify the sender by e-
mail and delete this message and any attachments immediately from this
system.
Kingston Communications (HULL) PLC is a public limited company incorporated
in England and Wales
with registration number 02150618 and whose registered office is at 37 Carr
Lane, Hull HU1 3RE
118 288 - Kingston UK Directory Enquiries. Each call costs 35p* for up to 3
searches, calls from
mobiles and other networks may vary. *As at 01/03/04.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-12-22 15:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-22 7:39 #ident query Barry Clarkson
2004-12-22 8:02 ` Ken Foskey
2004-12-22 12:32 ` Eljay Love-Jensen
2004-12-22 15:50 ` Ian Lance Taylor
-- strict thread matches above, loose matches on Subject: below --
2004-12-20 11:03 Barry Clarkson
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).