Bug 427634 - gcc-4.3 incorrectly warns about static data in an inline function
gcc-4.3 incorrectly warns about static data in an inline function
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-05 17:59 EST by James Antill
Modified: 2008-01-30 03:57 EST (History)
0 users

See Also:
Fixed In Version: 4.3.0-0.7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-30 03:57:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description James Antill 2008-01-05 17:59:35 EST
Description of problem:

 GCC 4.3 incorrectly warns about "static const" data that is declared inside
an inline function. While warning about "static" data is correct, const isn't.

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

 Whatever is in:
koji build --scratch dist-f9-gcc43

Steps to Reproduce:
 The code looks like:

inline size_t ustr_xi__pow2(int use_big, unsigned char len)
{
  static const unsigned char map_big_pow2[4] = {2, 4, 8, 16};
  static const unsigned char map_pow2[4] = {0, 1, 2,  4};
  
  if (use_big)
    return (map_big_pow2[len & 0x03]);
  
  return (map_pow2[len & 0x03]);
}

...AIUI. this is the correct way to write the above function.


Additional info:

 This is mainly being built to make sure Ustr doesn't break the C99 inline
rules, which I think it doesn't due to the separate extern statement, however if
it is that might be contributing to the problem.

http://koji.fedoraproject.org/koji/getfile?taskID=327537&name=build.log
Comment 1 James Antill 2008-01-05 18:06:17 EST
 It's in debian too, mainly here so I can update them:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450506
Comment 2 Jakub Jelinek 2008-01-30 03:57:36 EST
http://gcc.gnu.org/ml/gcc-patches/2008-01/msg01432.html
Will be fixed in gcc-4.3.0-0.7.

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