Remove non-ANSI C path in ansidecl.h.

Message ID 657a408d-7d92-0714-5528-230e3f17ad93@suse.cz
State New
Headers
Series Remove non-ANSI C path in ansidecl.h. |

Commit Message

Martin Liška May 5, 2022, 12:18 p.m. UTC
  Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

include/ChangeLog:

	* ansidecl.h (PTR): Remove Not ANCI C part.
---
 include/ansidecl.h | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
  

Comments

Richard Biener May 5, 2022, 12:27 p.m. UTC | #1
On Thu, May 5, 2022 at 2:19 PM Martin Liška <mliska@suse.cz> wrote:
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
> include/ChangeLog:
>
>         * ansidecl.h (PTR): Remove Not ANCI C part.
> ---
>  include/ansidecl.h | 16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/include/ansidecl.h b/include/ansidecl.h
> index 4275c9b9cbd..f42c6afc7e9 100644
> --- a/include/ansidecl.h
> +++ b/include/ansidecl.h
> @@ -89,21 +89,7 @@ So instead we use the macro below and test it against specific values.  */
>  # endif
>  #endif
>
> -#else  /* Not ANSI C.  */
> -
> -#define PTR            char *
> -
> -/* some systems define these in header files for non-ansi mode */
> -#undef const
> -#undef volatile
> -#undef signed
> -#undef inline
> -#define const
> -#define volatile
> -#define signed
> -#define inline
> -
> -#endif /* ANSI C.  */

You'd have to ask the sourceware side as well (binutils), but for sure
either the
guarding #if should be removed or the #else path should contain an #error.

Richard.

> +#endif
>
>  /* Define macros for some gcc attributes.  This permits us to use the
>     macros freely, and know that they will come into play for the
> --
> 2.36.0
>
  
Eric Gallager May 6, 2022, 1:30 a.m. UTC | #2
On Thu, May 5, 2022 at 8:27 AM Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Thu, May 5, 2022 at 2:19 PM Martin Liška <mliska@suse.cz> wrote:
> >
> > Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> >
> > Ready to be installed?
> > Thanks,
> > Martin
> >
> > include/ChangeLog:
> >
> >         * ansidecl.h (PTR): Remove Not ANCI C part.
> > ---
> >  include/ansidecl.h | 16 +---------------
> >  1 file changed, 1 insertion(+), 15 deletions(-)
> >
> > diff --git a/include/ansidecl.h b/include/ansidecl.h
> > index 4275c9b9cbd..f42c6afc7e9 100644
> > --- a/include/ansidecl.h
> > +++ b/include/ansidecl.h
> > @@ -89,21 +89,7 @@ So instead we use the macro below and test it against specific values.  */
> >  # endif
> >  #endif
> >
> > -#else  /* Not ANSI C.  */
> > -
> > -#define PTR            char *
> > -
> > -/* some systems define these in header files for non-ansi mode */
> > -#undef const
> > -#undef volatile
> > -#undef signed
> > -#undef inline
> > -#define const
> > -#define volatile
> > -#define signed
> > -#define inline
> > -
> > -#endif /* ANSI C.  */
>
> You'd have to ask the sourceware side as well (binutils), but for sure
> either the
> guarding #if should be removed or the #else path should contain an #error.

Maybe just make it a #warning for one release, and then if no one
complains, turn it into an #error in the following release?

>
> Richard.
>
> > +#endif
> >
> >  /* Define macros for some gcc attributes.  This permits us to use the
> >     macros freely, and know that they will come into play for the
> > --
> > 2.36.0
> >
  
Martin Liška May 9, 2022, 11:47 a.m. UTC | #3
On 5/5/22 14:27, Richard Biener wrote:
> You'd have to ask the sourceware side as well (binutils), but for sure
> either the

Yes, I've asked and they proved that.

> guarding #if should be removed or the #else path should contain an #error.

All right, I'm going to install the version w/o #if.

Martin
  

Patch

diff --git a/include/ansidecl.h b/include/ansidecl.h
index 4275c9b9cbd..f42c6afc7e9 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -89,21 +89,7 @@  So instead we use the macro below and test it against specific values.  */
 # endif
 #endif
 
-#else	/* Not ANSI C.  */
-
-#define PTR		char *
-
-/* some systems define these in header files for non-ansi mode */
-#undef const
-#undef volatile
-#undef signed
-#undef inline
-#define const
-#define volatile
-#define signed
-#define inline
-
-#endif	/* ANSI C.  */
+#endif
 
 /* Define macros for some gcc attributes.  This permits us to use the
    macros freely, and know that they will come into play for the