public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/55530] New: Visibility warning not always shown
@ 2012-11-29 13:34 jaak at ristioja dot ee
  2012-11-29 13:38 ` [Bug other/55530] " jaak at ristioja dot ee
  2012-12-09  1:54 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jaak at ristioja dot ee @ 2012-11-29 13:34 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55530

             Bug #: 55530
           Summary: Visibility warning not always shown
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jaak@ristioja.ee


struct __attribute__ ((visibility("internal"))) A {};
struct B { A * a; }; /* warning: 'B' declared with greater visibility than the
type of its field 'B::a' [-Wattributes] */

struct C;
struct D { B * a; }; /* No warning */
struct __attribute__ ((visibility("internal"))) C {};

Similar behaviour with both gcc and g++.

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check
--with-cloog-include=/usr/include/cloog-ppl --enable-lto --disable-nls
--with-system-zlib --enable-obsolete --disable-werror --enable-secureplt
--enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/python
--enable-checking=release --disable-libgcj --enable-languages=c,c++,go,fortran
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.6.3 p1.8, pie-0.5.2'
Thread model: posix
gcc version 4.6.3 (Gentoo 4.6.3 p1.8, pie-0.5.2)

Please move bug to the appropriate component.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug other/55530] Visibility warning not always shown
  2012-11-29 13:34 [Bug other/55530] New: Visibility warning not always shown jaak at ristioja dot ee
@ 2012-11-29 13:38 ` jaak at ristioja dot ee
  2012-12-09  1:54 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jaak at ristioja dot ee @ 2012-11-29 13:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55530

--- Comment #1 from Jaak Ristioja <jaak at ristioja dot ee> 2012-11-29 13:37:29 UTC ---
Sorry, the minimal testcase should have been:

struct __attribute__ ((visibility("internal"))) A {};
struct B { A * a; }; /* warning: 'B' declared with greater visibility than the
type of its field 'B::a' [-Wattributes] */

struct C;
struct D { C * c; }; /* No warning */
struct __attribute__ ((visibility("internal"))) C {};


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug other/55530] Visibility warning not always shown
  2012-11-29 13:34 [Bug other/55530] New: Visibility warning not always shown jaak at ristioja dot ee
  2012-11-29 13:38 ` [Bug other/55530] " jaak at ristioja dot ee
@ 2012-12-09  1:54 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-12-09  1:54 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55530

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-09
     Ever Confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-12-09 01:54:20 UTC ---
The warning happens when the struct at definition time rather than at the end
of compilation.  Maybe we should warn about the case where the forward
declaration and definitions are two different visibility.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-09  1:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-29 13:34 [Bug other/55530] New: Visibility warning not always shown jaak at ristioja dot ee
2012-11-29 13:38 ` [Bug other/55530] " jaak at ristioja dot ee
2012-12-09  1:54 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).