Bug 31844 - Incorrect source locations and number of warnings for unsupported visibility attribute
Summary: Incorrect source locations and number of warnings for unsupported visibility ...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P5 trivial
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic, visibility
Depends on:
Blocks: visibility
  Show dependency treegraph
 
Reported: 2007-05-06 16:08 UTC by Dave Korn
Modified: 2021-10-08 20:38 UTC (History)
1 user (show)

See Also:
Host: i686-pc-cygwin
Target: i686-pc-cygwin
Build: i686-pc-cygwin
Known to work:
Known to fail:
Last reconfirmed: 2009-08-09 22:03:51


Attachments
Testcase as described in summary. (122 bytes, text/plain)
2007-05-06 16:10 UTC, Dave Korn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Korn 2007-05-06 16:08:58 UTC
This testcase:

/gnu $ cat -n vis.cpp
     1  int j2 __attribute__ ((visibility ("hidden")));
     2
     3
     4
     5
     6
     7
     8  int __attribute__ ((visibility ("protected"))) foo (int bar)
     9  {
    10    return bar + 3;
    11  }
    12
    13
    14
    15
    16
    17
    18
    19  int i __attribute__ ((visibility ("hidden")));
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30  int j __attribute__ ((visibility ("default")));
    31
    32
    33

  Produces seemingly mis-located warnings, both on recent trunk:

/gnu $ g++ -S vis.cpp -o vis.asm
vis.cpp: In function 'int foo(int)':
vis.cpp:11: warning: visibility attribute not supported in this configuration; ignored
vis.cpp: At global scope:
vis.cpp:29: warning: visibility attribute not supported in this configuration; ignored
vis.cpp:29: warning: visibility attribute not supported in this configuration; ignored
/gnu $ g++ -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: /gnu/gcc/gcc/configure --prefix=/gnu/install -v --enable-languages=c,c++,java
Thread model: single
gcc version 4.3.0 20070421 (experimental)

  ... and the 4.2.0 RC3 tarball:


/gnu $ g++ -S vis.cpp -o vis.asm
vis.cpp: In function 'int foo(int)':
vis.cpp:11: warning: visibility attribute not supported in this configuration; ignored
vis.cpp: At global scope:
vis.cpp:29: warning: visibility attribute not supported in this configuration; ignored
vis.cpp:29: warning: visibility attribute not supported in this configuration; ignored
/gnu $ g++ -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: /gnu/gcc/rc2/gcc-4.2.0-20070501/configure --prefix=/gnu/install/bin --with-gmp=/usr --with-mpfr=/usr -v
Thread model: single
gcc version 4.2.0 20070501 (prerelease)

(Wasn't sure which version to file this against)
Comment 1 Dave Korn 2007-05-06 16:10:42 UTC
Created attachment 13516 [details]
Testcase as described in summary.

Not preprocessed, but this testcase is not affected by preprocessing anyway.
Comment 2 Dave Korn 2009-08-09 22:03:50 UTC
Still present, although the location has slipped slightly for the warnings on the function declarations with no body.

$ g++ -S vis.cpp -o vis.asm
vis.cpp: In function 'int foo(int)':
vis.cpp:11: warning: visibility attribute not supported in this configuration; i
gnored
vis.cpp: At global scope:
vis.cpp:30: warning: visibility attribute not supported in this configuration; i
gnored
vis.cpp:30: warning: visibility attribute not supported in this configuration; i
gnored

  Confirming, but lowering the severity and priority.
Comment 3 Dave Korn 2010-02-17 15:29:20 UTC
Just reconfirmed with recent pre-4.5.0 HEAD:

$ /gnu/gcc/install-pr42811-3/opt/gcc-tools/bin/g++-4.exe  -S vis.cpp -o vis.asm
vis.cpp:30:47: warning: visibility attribute not supported in this configuration; ignored
vis.cpp: In function 'int foo(int)':
vis.cpp:11:1: warning: visibility attribute not supported in this configuration; ignored
vis.cpp: At global scope:
vis.cpp:30:47: warning: visibility attribute not supported in this configuration; ignored

Still trivial.