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/68344] New: No warning for old-style function declarations.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68344

            Bug ID: 68344
           Summary: No warning for old-style function declarations.
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: i.hamsa at gmail dot com
  Target Milestone: ---

The following minimal test case

    int a();

generates no warning when -Wold-style-declaration -std=c11 is specified.

It is expected that a warning should be produced.

The manual at https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html says:

-Wold-style-declaration
    Warn for obsolescent usages, according to the C Standard, in a declaration

The C11 draft standard says:
    6.11.6 Function declarators
    The use of function declarators with empty parentheses (not prototype-
    format parameter type declarators) is an obsolescent feature.

===
Information about the compiler:

* output of gcc -v
Using built-in specs.
COLLECT_GCC=gcc-5.2.0
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/5.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-5.2.0/work/gcc-5.2.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/5.2.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.2.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.2.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/5.2.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 5.2.0 p1.0, pie-0.6.3' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts
--enable-lto --without-isl --enable-libsanitizer
Thread model: posix
gcc version 5.2.0 (Gentoo 5.2.0 p1.0, pie-0.6.3)

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