public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PR24924 front end and preprocessor pedantic_errors settings should agree
@ 2007-01-27  9:12 Manuel López-Ibáñez
  2007-02-11 16:05 ` [PING^2] " Manuel López-Ibáñez
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel López-Ibáñez @ 2007-01-27  9:12 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

:ADDPATCH c++:

This patch makes the preprocessor to give an error for pedwarns by
default unless fpermissive is given, when the language is a dialect of
C++.

Boostrapped and regression tested.

Does it look OK to you?


2007-01-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

  PR c++/24924
  * c-opts.c (c_common_post_options): Handle C++ post-processing here.
Set also -pedantic-errors by default for the  preprocessor unless
-fpermissive is given.

cp/
  * decl.c (cxx_init_decl_processing): Move command-line options
processing to c-opts.c.

testsuite/
  * g++.dg/cpp/pedantic-errors.C: New.
  * g++.dg/cpp/permissive.C: New.

[-- Attachment #2: pedantic-cpp-errors.diff --]
[-- Type: text/plain, Size: 2331 bytes --]

Index: gcc/testsuite/g++.dg/cpp/pedantic-errors.C
===================================================================
--- gcc/testsuite/g++.dg/cpp/pedantic-errors.C	(revision 0)
+++ gcc/testsuite/g++.dg/cpp/pedantic-errors.C	(revision 0)
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98" } */
+
+#if 1   
+#endif 1 /* { dg-error "error: extra tokens at end of #endif directive" } */
Index: gcc/testsuite/g++.dg/cpp/permissive.C
===================================================================
--- gcc/testsuite/g++.dg/cpp/permissive.C	(revision 0)
+++ gcc/testsuite/g++.dg/cpp/permissive.C	(revision 0)
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98 -fpermissive" } */
+
+#if 1   
+#endif 1 /* { dg-warning "warning: extra tokens at end of #endif directive" } */
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c	(revision 121039)
+++ gcc/cp/decl.c	(working copy)
@@ -3142,17 +3142,6 @@ cxx_init_decl_processing (void)
 
   current_lang_name = NULL_TREE;
 
-  /* Adjust various flags based on command-line settings.  */
-  if (!flag_permissive)
-    flag_pedantic_errors = 1;
-  if (!flag_no_inline)
-    {
-      flag_inline_trees = 1;
-      flag_no_inline = 1;
-    }
-  if (flag_inline_functions)
-    flag_inline_trees = 2;
-
   /* Force minimum function alignment if using the least significant
      bit of function pointers to store the virtual bit.  */
   if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
Index: gcc/c-opts.c
===================================================================
--- gcc/c-opts.c	(revision 121039)
+++ gcc/c-opts.c	(working copy)
@@ -1060,6 +1060,23 @@ c_common_post_options (const char **pfil
   if (warn_overlength_strings == -1 || c_dialect_cxx ())
     warn_overlength_strings = 0;
 
+  /* Adjust various flags for C++ based on command-line settings.  */
+  if (c_dialect_cxx ())
+    {
+      if (!flag_permissive)
+	{
+	  flag_pedantic_errors = 1;
+	  cpp_opts->pedantic_errors = 1;
+	}
+      if (!flag_no_inline)
+	{
+	  flag_inline_trees = 1;
+	  flag_no_inline = 1;
+	}
+      if (flag_inline_functions)
+	flag_inline_trees = 2;
+    }
+
   /* Special format checking options don't work without -Wformat; warn if
      they are used.  */
   if (!warn_format)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PING^2] PR24924 front end and preprocessor pedantic_errors settings should agree
  2007-01-27  9:12 PR24924 front end and preprocessor pedantic_errors settings should agree Manuel López-Ibáñez
@ 2007-02-11 16:05 ` Manuel López-Ibáñez
  2007-02-19 23:36   ` [PING^3] " Manuel López-Ibáñez
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-11 16:05 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html

Re-diffed, re-bootstrapped and re-regression-tested.



On 27/01/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> :ADDPATCH c++:
>
> This patch makes the preprocessor to give an error for pedwarns by
> default unless fpermissive is given, when the language is a dialect of
> C++.
>
> Boostrapped and regression tested.
>
> Does it look OK to you?
>
>
> 2007-01-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
>
>   PR c++/24924
>   * c-opts.c (c_common_post_options): Handle C++ post-processing here.
> Set also -pedantic-errors by default for the  preprocessor unless
> -fpermissive is given.
>
> cp/
>   * decl.c (cxx_init_decl_processing): Move command-line options
> processing to c-opts.c.
>
> testsuite/
>   * g++.dg/cpp/pedantic-errors.C: New.
>   * g++.dg/cpp/permissive.C: New.
>
>

[-- Attachment #2: pedantic-cpp-errors.diff --]
[-- Type: text/plain, Size: 2331 bytes --]

Index: gcc/testsuite/g++.dg/cpp/pedantic-errors.C
===================================================================
--- gcc/testsuite/g++.dg/cpp/pedantic-errors.C	(revision 0)
+++ gcc/testsuite/g++.dg/cpp/pedantic-errors.C	(revision 0)
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98" } */
+
+#if 1   
+#endif 1 /* { dg-error "error: extra tokens at end of #endif directive" } */
Index: gcc/testsuite/g++.dg/cpp/permissive.C
===================================================================
--- gcc/testsuite/g++.dg/cpp/permissive.C	(revision 0)
+++ gcc/testsuite/g++.dg/cpp/permissive.C	(revision 0)
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98 -fpermissive" } */
+
+#if 1   
+#endif 1 /* { dg-warning "warning: extra tokens at end of #endif directive" } */
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c	(revision 121678)
+++ gcc/cp/decl.c	(working copy)
@@ -3143,17 +3143,6 @@ cxx_init_decl_processing (void)
 
   current_lang_name = NULL_TREE;
 
-  /* Adjust various flags based on command-line settings.  */
-  if (!flag_permissive)
-    flag_pedantic_errors = 1;
-  if (!flag_no_inline)
-    {
-      flag_inline_trees = 1;
-      flag_no_inline = 1;
-    }
-  if (flag_inline_functions)
-    flag_inline_trees = 2;
-
   /* Force minimum function alignment if using the least significant
      bit of function pointers to store the virtual bit.  */
   if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
Index: gcc/c-opts.c
===================================================================
--- gcc/c-opts.c	(revision 121678)
+++ gcc/c-opts.c	(working copy)
@@ -1061,6 +1061,23 @@ c_common_post_options (const char **pfil
   if (warn_overlength_strings == -1 || c_dialect_cxx ())
     warn_overlength_strings = 0;
 
+  /* Adjust various flags for C++ based on command-line settings.  */
+  if (c_dialect_cxx ())
+    {
+      if (!flag_permissive)
+	{
+	  flag_pedantic_errors = 1;
+	  cpp_opts->pedantic_errors = 1;
+	}
+      if (!flag_no_inline)
+	{
+	  flag_inline_trees = 1;
+	  flag_no_inline = 1;
+	}
+      if (flag_inline_functions)
+	flag_inline_trees = 2;
+    }
+
   /* Special format checking options don't work without -Wformat; warn if
      they are used.  */
   if (!warn_format)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING^3] PR24924 front end and preprocessor pedantic_errors settings should agree
  2007-02-11 16:05 ` [PING^2] " Manuel López-Ibáñez
@ 2007-02-19 23:36   ` Manuel López-Ibáñez
  2007-03-01 18:30     ` [PING^4] " Manuel López-Ibáñez
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-19 23:36 UTC (permalink / raw)
  To: gcc-patches List

PING^3:  http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html

Thanks,

Manuel.

On 11/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html
>
> Re-diffed, re-bootstrapped and re-regression-tested.
>
>
>
> On 27/01/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > :ADDPATCH c++:
> >
> > This patch makes the preprocessor to give an error for pedwarns by
> > default unless fpermissive is given, when the language is a dialect of
> > C++.
> >
> > Boostrapped and regression tested.
> >
> > Does it look OK to you?
> >
> >
> > 2007-01-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> >
> >   PR c++/24924
> >   * c-opts.c (c_common_post_options): Handle C++ post-processing here.
> > Set also -pedantic-errors by default for the  preprocessor unless
> > -fpermissive is given.
> >
> > cp/
> >   * decl.c (cxx_init_decl_processing): Move command-line options
> > processing to c-opts.c.
> >
> > testsuite/
> >   * g++.dg/cpp/pedantic-errors.C: New.
> >   * g++.dg/cpp/permissive.C: New.
> >
> >
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PING^4] PR24924 front end and preprocessor pedantic_errors settings should agree
  2007-02-19 23:36   ` [PING^3] " Manuel López-Ibáñez
@ 2007-03-01 18:30     ` Manuel López-Ibáñez
  2007-03-14 22:58       ` [PING^5] " Manuel López-Ibáñez
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel López-Ibáñez @ 2007-03-01 18:30 UTC (permalink / raw)
  To: gcc-patches List

PING^4: http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html

Thanks,

Manuel.

On 19/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> PING^3:  http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html
>
> Thanks,
>
> Manuel.
>
> On 11/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html
> >
> > Re-diffed, re-bootstrapped and re-regression-tested.
> >
> >
> >
> > On 27/01/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > > :ADDPATCH c++:
> > >
> > > This patch makes the preprocessor to give an error for pedwarns by
> > > default unless fpermissive is given, when the language is a dialect of
> > > C++.
> > >
> > > Boostrapped and regression tested.
> > >
> > > Does it look OK to you?
> > >
> > >
> > > 2007-01-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> > >
> > >   PR c++/24924
> > >   * c-opts.c (c_common_post_options): Handle C++ post-processing here.
> > > Set also -pedantic-errors by default for the  preprocessor unless
> > > -fpermissive is given.
> > >
> > > cp/
> > >   * decl.c (cxx_init_decl_processing): Move command-line options
> > > processing to c-opts.c.
> > >
> > > testsuite/
> > >   * g++.dg/cpp/pedantic-errors.C: New.
> > >   * g++.dg/cpp/permissive.C: New.
> > >
> > >
> >
> >
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PING^5] PR24924 front end and preprocessor pedantic_errors settings should agree
  2007-03-01 18:30     ` [PING^4] " Manuel López-Ibáñez
@ 2007-03-14 22:58       ` Manuel López-Ibáñez
  2007-03-15  5:21         ` Ian Lance Taylor
  2007-03-15  6:09         ` Mark Mitchell
  0 siblings, 2 replies; 8+ messages in thread
From: Manuel López-Ibáñez @ 2007-03-14 22:58 UTC (permalink / raw)
  To: gcc-patches List

Two weeks later...
PING^5: http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html

Who is the C preprocessor maintainer? I couldn't find it from MAINTAINERS.

Cheers,

Manuel.

On 01/03/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> PING^4: http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html
>
> Thanks,
>
> Manuel.
>
> On 19/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > PING^3:  http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html
> >
> > Thanks,
> >
> > Manuel.
> >
> > On 11/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > > http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html
> > >
> > > Re-diffed, re-bootstrapped and re-regression-tested.
> > >
> > >
> > >
> > > On 27/01/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > > > :ADDPATCH c++:
> > > >
> > > > This patch makes the preprocessor to give an error for pedwarns by
> > > > default unless fpermissive is given, when the language is a dialect of
> > > > C++.
> > > >
> > > > Boostrapped and regression tested.
> > > >
> > > > Does it look OK to you?
> > > >
> > > >
> > > > 2007-01-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> > > >
> > > >   PR c++/24924
> > > >   * c-opts.c (c_common_post_options): Handle C++ post-processing here.
> > > > Set also -pedantic-errors by default for the  preprocessor unless
> > > > -fpermissive is given.
> > > >
> > > > cp/
> > > >   * decl.c (cxx_init_decl_processing): Move command-line options
> > > > processing to c-opts.c.
> > > >
> > > > testsuite/
> > > >   * g++.dg/cpp/pedantic-errors.C: New.
> > > >   * g++.dg/cpp/permissive.C: New.
> > > >
> > > >
> > >
> > >
> >
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING^5] PR24924 front end and preprocessor pedantic_errors settings should agree
  2007-03-14 22:58       ` [PING^5] " Manuel López-Ibáñez
@ 2007-03-15  5:21         ` Ian Lance Taylor
  2007-03-15  5:33           ` Mark Mitchell
  2007-03-15  6:09         ` Mark Mitchell
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Lance Taylor @ 2007-03-15  5:21 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches List

"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:

> Who is the C preprocessor maintainer? I couldn't find it from MAINTAINERS.

The C preprocessor maintainer is listed under cpplib:

cpplib			Per Bothner		per@bothner.com

Unfortunately I, at least, haven't heard from Per for some time.  The
library is effectively orphaned: only global maintainers can approve
patches.  There are several cpplib patches waiting for review.

Ian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING^5] PR24924 front end and preprocessor pedantic_errors settings  should agree
  2007-03-15  5:21         ` Ian Lance Taylor
@ 2007-03-15  5:33           ` Mark Mitchell
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Mitchell @ 2007-03-15  5:33 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Manuel López-Ibáñez, gcc-patches List

Ian Lance Taylor wrote:
> "Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:
> 
>> Who is the C preprocessor maintainer? I couldn't find it from MAINTAINERS.
> 
> The C preprocessor maintainer is listed under cpplib:
> 
> cpplib			Per Bothner		per@bothner.com
> 
> Unfortunately I, at least, haven't heard from Per for some time.  The
> library is effectively orphaned: only global maintainers can approve
> patches.  There are several cpplib patches waiting for review.

I think that, given this situation, we should make all C and C++
maintainers also maintainers of cpplib.  They're probably the closest
thing we have to preprocessor experts.  Do you think that's reasonable?

If there are no objections, I can suggest it to the SC.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PING^5] PR24924 front end and preprocessor pedantic_errors settings  should agree
  2007-03-14 22:58       ` [PING^5] " Manuel López-Ibáñez
  2007-03-15  5:21         ` Ian Lance Taylor
@ 2007-03-15  6:09         ` Mark Mitchell
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Mitchell @ 2007-03-15  6:09 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches List

Manuel López-Ibáñez wrote:
> Two weeks later...
> PING^5: http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02234.html

This patch is OK, thanks.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-03-15  5:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-27  9:12 PR24924 front end and preprocessor pedantic_errors settings should agree Manuel López-Ibáñez
2007-02-11 16:05 ` [PING^2] " Manuel López-Ibáñez
2007-02-19 23:36   ` [PING^3] " Manuel López-Ibáñez
2007-03-01 18:30     ` [PING^4] " Manuel López-Ibáñez
2007-03-14 22:58       ` [PING^5] " Manuel López-Ibáñez
2007-03-15  5:21         ` Ian Lance Taylor
2007-03-15  5:33           ` Mark Mitchell
2007-03-15  6:09         ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).