Bug 194455 - SCCS Ident strings stripped by over-zealous optimiser
SCCS Ident strings stripped by over-zealous optimiser
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
i386 Linux
medium Severity urgent
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2006-06-08 06:36 EDT by Jonathan Allen
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-06-08 07:01:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jonathan Allen 2006-06-08 06:36:49 EDT
Description of problem:

The SCCS-style ident strings have all been optimised out by the C compiler.
This makes it impossible to see what components are included in a binary
by doing the standard:  strings <bin-file> | grep "@(#)" | sort | more

Version-Release number of selected component (if applicable):

gcc 4.0.2 20051125

How reproducible:

100% - just include the line:

   static char ident[] = "@(#) filename.c";

in a C source file and don't reference the string

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Jakub Jelinek 2006-06-08 07:01:26 EDT
That's intentional, if you want the string kept in, either you need to compile
without optimizatins, or tell GCC you want to keep the variable eventhough
it is not used (add __attribute__((__used__)) to it).

Note You need to log in before you can comment on or make changes to this bug.