Bug 194455

Summary: SCCS Ident strings stripped by over-zealous optimiser
Product: [Fedora] Fedora Reporter: Jonathan Allen <jonathan>
Component: gcc4Assignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: urgent Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-06-08 11:01:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Allen 2006-06-08 10:36:49 UTC
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:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jakub Jelinek 2006-06-08 11:01:26 UTC
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).