Bug 194455 - SCCS Ident strings stripped by over-zealous optimiser
Summary: SCCS Ident strings stripped by over-zealous optimiser
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: 4
Hardware: i386
OS: Linux
medium
urgent
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-06-08 10:36 UTC by Jonathan Allen
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-06-08 11:01:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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).


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