On Mon, Dec 27, 2021 at 09:50:04PM -0500, Kurt Mosiejczuk wrote:
> I find myself adding the following to many ports files nowadays
> 
> .include <bsd.port.arch.mk>
> .if !${PROPERTIES:Mclang}
> CFLAGS +=     -std=gnu99
> .endif
> 
> Rather than continue this, I'd like to propose adding BASE_C99 to bsd.port.mk
> 
> When BASE_C99= Yes, if on a non-base-clang arch, it will add the same to
> CFLAGS, but without including bsd.port.arch.mk by hand.
> 
> Included are patches to add this to bsd.port.mk and a diff for bsd.port.mk(5)
> to include it in the man page.
> 
> Once this is in, I'll sweep the tree for the boilerplate and replace it all
> with this.
> 
> ok?

Is it time to consider changing the gcc default to gnu99?
built and installed on sparc64 but otherwise untested.

--- /tmp/defs.old       Sun Dec 19 15:25:52 2021
+++ /tmp/defs.new       Sun Dec 19 16:34:59 2021
@@ -70,6 +70,7 @@
 #define __FLT_HAS_INFINITY__ 1
 #define __DEC64_MAX__ 9.999999999999999E384DD
 #define __DEC64_MANT_DIG__ 16
+#define __STDC_VERSION__ 199901L
 #define __DEC32_MAX_EXP__ 96
 #define __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
 #define __LDBL_MANT_DIG__ 113

Index: gnu/gcc/gcc/c-opts.c
===================================================================
RCS file: /cvs/src/gnu/gcc/gcc/c-opts.c,v
retrieving revision 1.3
diff -u -p -r1.3 c-opts.c
--- gnu/gcc/gcc/c-opts.c        15 Sep 2011 12:19:12 -0000      1.3
+++ gnu/gcc/gcc/c-opts.c        28 Dec 2021 03:44:20 -0000
@@ -236,6 +236,8 @@ c_common_init_options (unsigned int argc
 
   if (c_language == clk_c)
     {
+      set_std_c99 (false /* ISO */);
+
       /* If preprocessing assembly language, accept any of the C-family
         front end options since the driver may pass them through.  */
       for (i = 1; i < argc; i++)

Reply via email to