[Bug c/53075] -Werror=pedantic should be equivalent to -pedantic-errors

2019-09-02 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53075

--- Comment #5 from Manuel López-Ibáñez  ---
(In reply to Kamlesh Kumar from comment #4)
> This patch resolves this.

No, it doesn't.

As the documentation says: -pedantic-errors is not equivalent to
@option{-Werror=pedantic}, since there are errors enabled by this option
and not enabled by the latter and vice versa.

According to the discussion in the email threads above, it is not possible to
make them equivalent, one would need to create a new options for everything
that is in the disjoint set of -pedantic-errors and -Werror=pedantic (but there
may be some bugs worth fixing there to reduce this set).

In any case, patches are sent to gcc-patches:
https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps

[Bug c/53075] -Werror=pedantic should be equivalent to -pedantic-errors

2019-09-02 Thread kamleshbhalui at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53075

Kamlesh Kumar  changed:

   What|Removed |Added

 CC||kamleshbhalui at gmail dot com

--- Comment #4 from Kamlesh Kumar  ---
This patch resolves this.

diff --git a/gcc/opts.c b/gcc/opts.c
index 1417dba..2e71fef 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -3212,7 +3212,7 @@ option_name (diagnostic_context *context, int
option_index,
   if (option_index)
 {
   /* A warning classified as an error.  */
-  if ((orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN)
+  if ((context->pedantic_errors || orig_diag_kind == DK_WARNING ||
orig_diag_kind == DK_PEDWARN)
  && diag_kind == DK_ERROR)
return concat (cl_options[OPT_Werror_].opt_text,
   /* Skip over "-W".  */

[Bug c/53075] -Werror=pedantic should be equivalent to -pedantic-errors

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

Eric Gallager  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=53072

--- Comment #3 from Eric Gallager  ---
(In reply to Manuel López-Ibáñez from comment #0)
> Some background discussion in PR 44774 and
> http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01324.html

bug 53072 came up under that discussion; adding it under "See Also" here

> 
> A currently visible effect is that
> 
> $ cc1  ~/trunk/src/gcc/testsuite/gcc.dg/c90-init-1.c -pedantic-errors
> 
> prints -Wpedantic while
> 
> $ cc1  ~/trunk/src/gcc/testsuite/gcc.dg/c90-init-1.c -Werror=pedantic
> 
> prints -Werror=pedantic (as it should).

[Bug c/53075] -Werror=pedantic should be equivalent to -pedantic-errors

2017-07-27 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53075

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-27
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Eric Gallager  ---
Confirmed.

[Bug c/53075] -Werror=pedantic should be equivalent to -pedantic-errors

2015-01-18 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53075

--- Comment #1 from Manuel López-Ibáñez manu at gcc dot gnu.org ---
More discussion in the topic:
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01799.html