Add new warning flag "warn_prio_ctor_dtor"
Vinay Kumar
vinay.kumar@blackfigtech.com
Thu Aug 30 14:25:00 GMT 2018
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcvxwgcc-222-1.patch
Type: application/octet-stream
Size: 5140 bytes
Desc: tcvxwgcc-222-1.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180830/772f5f82/attachment.obj>
More information about the Gcc-patches
mailing list