This is the mail archive of the gcc-patches@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]

Add new warning flag "warn_prio_ctor_dtor"


Hi,

This patch adds a warning flag that nullifies warnings when priorities
in constructor or destructor are assigned from 0 - 100.
There are some low-level constructors that are part of the implementation. 
In such cases, the option will be useful to avoid unnecessary warnings.

Please review the patch and let me know if its okay.
Tested on X86 Toolchain with no regressions.

2018-08-30  Vinay Kumar  <vinay.kumar@blackfigtech.com>

gcc
       * doc/invoke.texi (-Wreturn-type): Document new warning
       -Wprio-ctor-dtor.

c-family
       * c-attribs.c (get_priority): Add a warning flag warn_prio_ctor_dtor
       to generate constructor destructor priority warning.
       * c.opt (-Wprio-ctor-dtor): New option.

testsuite
       * c-c++-common/Wprio-ctor-dtor.c: New test.
       * g++.dg/warn/Wprio-ctor-dtor.C: New test.

Attachment: tcvxwgcc-222-1.patch
Description: tcvxwgcc-222-1.patch


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