[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2022-12-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

--- Comment #32 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:263c22a95bc9a0d80c4873c0291b0f938cea7310

commit r13-4795-g263c22a95bc9a0d80c4873c0291b0f938cea7310
Author: Jason Merrill 
Date:   Mon Dec 5 10:00:31 2022 -0500

build: add -Wconditionally-supported to strict_warn [PR64867]

The PR (which isn't resolved by this commit) pointed out to me that GCC
should build with -Wconditionally-supported to support bootstrapping with a
C++11 compiler that makes different choices.

PR c++/64867

gcc/ChangeLog:

* configure.ac (strict_warn): Add -Wconditionally-supported.
* configure: Regenerate.

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2022-12-05 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

Jason Merrill  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #31 from Jason Merrill  ---
(In reply to David Binderman from comment #30)
> gcc looks to be a trailer on this issue. It's not about standards conformance,
> its about making it easy for users to find bugs.

But under GCC it's not a bug, it just works.  Clang is welcome to adopt the
same semantics.  But I'm also happy to accept the patch in comment #17 once it
includes testing.

And GCC should build with -Wconditionally-supported so we support bootstrapping
with compilers that make different choices.

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2021-09-03 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

David Binderman  changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com

--- Comment #30 from David Binderman  ---
(In reply to Trass3r from comment #27)
> This should really be enabled by -Wall or -Wextra as it generates code that
> may easily crash or corrupt something.

+1.

Clang errors, intel warns and for gcc you have to enable the somewhat
obscure flag -Wconditionally-supported to see anything at all.

gcc looks to be a trailer on this issue. It's not about standards conformance,
its about making it easy for users to find bugs.

Source code I used is:

struct S
{
S();
S( const S &);
~S();

char * p;
};

void f( int, ...);

void g()
{
S s1;

f( 3, s1);
};

$ /home/dcb/llvm/results/bin/clang++   sep3f.cc
sep3f.cc:19:8: error: cannot pass object of non-trivial type 'S' through
variadic function; call will abort at runtime [-Wnon-pod-varargs]
f( 3, s1);
  ^
1 error generated.

$ /home/dcb34/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/icpc  sep3f.cc
sep3f.cc(19): warning #1595: a class type that is not trivially copyable passed
through ellipsis
f( 3, s1);
  ^

$ /home/dcb/gcc/results/bin/g++ -c -g -O2 -Wall -Wextra  sep3f.cc
$ /home/dcb/gcc/results/bin/g++ -c -g -O2 -Wall -Wextra
-Wconditionally-supported sep3f.cc
sep3f.cc: In function ‘void g()’:
sep3f.cc:19:10: warning: passing objects of non-trivially-copyable type ‘struct
S’ through ‘...’ is conditionally supported [-Wconditionally-supported]
   19 | f( 3, s1);
  | ~^~~~


I'll add flag -Wconditionally-supported to a build of Fedora and see
what happens.

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2020-01-25 Thread trass3r at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

--- Comment #29 from Trass3r  ---
Ah I see, ok.

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2020-01-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

--- Comment #28 from Andrew Pinski  ---
(In reply to Trass3r from comment #27)
> This should really be enabled by -Wall or -Wextra as it generates code that
> may easily crash or corrupt something.

But GCC supports this fully.  That is why it is/was part of
-Wconditionally-supported .  The code if used correctly does not cause crashes
or corrupts anything. 

In fact GCC documents this behavior:
https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Conditionally-supported-behavior.html#Conditionally-supported-behavior
:)

> Clang even turns it into an error by default and inserts a trap to abort at
> runtime: https://godbolt.org/z/8DAUAr
But clang does not support this.  Both compilers are correct; in that this
feature is considered as conditionally supported with implementation defined
behavior.  So both compilers are prefectly ok in having their own choices.

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2020-01-25 Thread trass3r at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

Trass3r  changed:

   What|Removed |Added

 CC||trass3r at gmail dot com

--- Comment #27 from Trass3r  ---
This should really be enabled by -Wall or -Wextra as it generates code that may
easily crash or corrupt something.
Clang even turns it into an error by default and inserts a trap to abort at
runtime: https://godbolt.org/z/8DAUAr

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2019-07-08 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

Eric Gallager  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #26 from Eric Gallager  ---
Martin Sebor has been doing stuff related to warnings about POD-ness lately;
cc-ing him

[Bug c++/64867] split warning for passing non-POD to varargs function from -Wconditionally-supported into new warning flag, -Wnon-pod-varargs

2019-04-09 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867

Eric Gallager  changed:

   What|Removed |Added

 Blocks||87403
Summary|warning for passing non-POD |split warning for passing
   |to varargs function |non-POD to varargs function
   ||from
   ||-Wconditionally-supported
   ||into new warning flag,
   ||-Wnon-pod-varargs

--- Comment #25 from Eric Gallager  ---
retitling


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87403
[Bug 87403] [Meta-bug] Issues that suggest a new warning