This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/54817] New: Warning about extern declarations in C and C++ files.


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

             Bug #: 54817
           Summary: Warning about extern declarations in C and C++ files.
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eugene.zelenko@gmail.com


Hi!

I think will be good idea if GCC will produce warnings when extern declarations
are placed in C/C++ files (not included from other files).

Such declarations are definitely belong to headers, so their appearance in
source files are indication of bad coding practices.

Intel compiler produces such warnings as "warning #1419: external declaration
in primary source file".

Eugene.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]