krb5 commit: Fix unknown pragma with clang on x-deltat.y

Greg Hudson ghudson at mit.edu
Fri Apr 14 12:14:34 EDT 2017


https://github.com/krb5/krb5/commit/77c0352d1d08609bc9000a7cbd1ee362fe120053
commit 77c0352d1d08609bc9000a7cbd1ee362fe120053
Author: Robbie Harwood <rharwood at redhat.com>
Date:   Wed Mar 29 16:28:56 2017 -0400

    Fix unknown pragma with clang on x-deltat.y
    
    Also re-generate deltat.c in order to clear the warning.

 src/lib/krb5/krb/deltat.c   |   76 ++++++++++++++++++++++---------------------
 src/lib/krb5/krb/x-deltat.y |    2 +
 2 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/src/lib/krb5/krb/deltat.c b/src/lib/krb5/krb/deltat.c
index 2c8b90b..7559b34 100644
--- a/src/lib/krb5/krb/deltat.c
+++ b/src/lib/krb5/krb/deltat.c
@@ -72,8 +72,10 @@
 #ifdef __GNUC__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wuninitialized"
+#ifndef __clang__
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
+#endif
 
 #include "k5-int.h"
 #include <ctype.h>
@@ -153,7 +155,7 @@ static int mylex(int *intp, struct param *tmv);
 static int yyparse(struct param *);
 
 
-#line 157 "deltat.c" /* yacc.c:339  */
+#line 159 "deltat.c" /* yacc.c:339  */
 
 # ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
@@ -197,10 +199,10 @@ extern int yydebug;
 typedef union YYSTYPE YYSTYPE;
 union YYSTYPE
 {
-#line 129 "x-deltat.y" /* yacc.c:355  */
+#line 131 "x-deltat.y" /* yacc.c:355  */
 int val;
 
-#line 204 "deltat.c" /* yacc.c:355  */
+#line 206 "deltat.c" /* yacc.c:355  */
 };
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
@@ -214,7 +216,7 @@ int yyparse (struct param *tmv);
 
 /* Copy the second part of user declarations.  */
 
-#line 218 "deltat.c" /* yacc.c:358  */
+#line 220 "deltat.c" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -512,9 +514,9 @@ static const yytype_uint8 yytranslate[] =
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,   143,   143,   144,   144,   145,   145,   146,   146,   147,
-     148,   150,   151,   152,   153,   154,   155,   156,   157,   162,
-     163,   166,   167,   170,   171
+       0,   145,   145,   146,   146,   147,   147,   148,   148,   149,
+     150,   152,   153,   154,   155,   156,   157,   158,   159,   164,
+     165,   168,   169,   172,   173
 };
 #endif
 
@@ -1310,93 +1312,93 @@ yyreduce:
   switch (yyn)
     {
         case 6:
-#line 145 "x-deltat.y" /* yacc.c:1646  */
+#line 147 "x-deltat.y" /* yacc.c:1646  */
     { (yyval.val) = - (yyvsp[0].val); }
-#line 1316 "deltat.c" /* yacc.c:1646  */
+#line 1318 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 9:
-#line 147 "x-deltat.y" /* yacc.c:1646  */
+#line 149 "x-deltat.y" /* yacc.c:1646  */
     { (yyval.val) = (yyvsp[0].val); }
-#line 1322 "deltat.c" /* yacc.c:1646  */
+#line 1324 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 10:
-#line 148 "x-deltat.y" /* yacc.c:1646  */
+#line 150 "x-deltat.y" /* yacc.c:1646  */
     { YYERROR; }
-#line 1328 "deltat.c" /* yacc.c:1646  */
+#line 1330 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 11:
-#line 150 "x-deltat.y" /* yacc.c:1646  */
+#line 152 "x-deltat.y" /* yacc.c:1646  */
     { DO ((yyvsp[-2].val),  0,  0, (yyvsp[0].val)); }
-#line 1334 "deltat.c" /* yacc.c:1646  */
+#line 1336 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 12:
-#line 151 "x-deltat.y" /* yacc.c:1646  */
+#line 153 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0, (yyvsp[-2].val),  0, (yyvsp[0].val)); }
-#line 1340 "deltat.c" /* yacc.c:1646  */
+#line 1342 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 13:
-#line 152 "x-deltat.y" /* yacc.c:1646  */
+#line 154 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0,  0, (yyvsp[-2].val), (yyvsp[0].val)); }
-#line 1346 "deltat.c" /* yacc.c:1646  */
+#line 1348 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 14:
-#line 153 "x-deltat.y" /* yacc.c:1646  */
+#line 155 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0,  0,  0, (yyvsp[-1].val)); }
-#line 1352 "deltat.c" /* yacc.c:1646  */
+#line 1354 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 15:
-#line 154 "x-deltat.y" /* yacc.c:1646  */
+#line 156 "x-deltat.y" /* yacc.c:1646  */
     { DO ((yyvsp[-6].val), (yyvsp[-4].val), (yyvsp[-2].val), (yyvsp[0].val)); }
-#line 1358 "deltat.c" /* yacc.c:1646  */
+#line 1360 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 16:
-#line 155 "x-deltat.y" /* yacc.c:1646  */
+#line 157 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0, (yyvsp[-4].val), (yyvsp[-2].val), (yyvsp[0].val)); }
-#line 1364 "deltat.c" /* yacc.c:1646  */
+#line 1366 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 17:
-#line 156 "x-deltat.y" /* yacc.c:1646  */
+#line 158 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0, (yyvsp[-2].val), (yyvsp[0].val),  0); }
-#line 1370 "deltat.c" /* yacc.c:1646  */
+#line 1372 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 18:
-#line 157 "x-deltat.y" /* yacc.c:1646  */
+#line 159 "x-deltat.y" /* yacc.c:1646  */
     { DO ( 0,  0,  0, (yyvsp[0].val)); }
-#line 1376 "deltat.c" /* yacc.c:1646  */
+#line 1378 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 20:
-#line 163 "x-deltat.y" /* yacc.c:1646  */
+#line 165 "x-deltat.y" /* yacc.c:1646  */
     { if (HOUR_NOT_OK((yyvsp[-2].val))) YYERROR;
 	                                  DO_SUM((yyval.val), (yyvsp[-2].val) * 3600, (yyvsp[0].val)); }
-#line 1383 "deltat.c" /* yacc.c:1646  */
+#line 1385 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 22:
-#line 167 "x-deltat.y" /* yacc.c:1646  */
+#line 169 "x-deltat.y" /* yacc.c:1646  */
     { if (MIN_NOT_OK((yyvsp[-2].val))) YYERROR;
 	                                  DO_SUM((yyval.val), (yyvsp[-2].val) * 60, (yyvsp[0].val)); }
-#line 1390 "deltat.c" /* yacc.c:1646  */
+#line 1392 "deltat.c" /* yacc.c:1646  */
     break;
 
   case 23:
-#line 170 "x-deltat.y" /* yacc.c:1646  */
+#line 172 "x-deltat.y" /* yacc.c:1646  */
     { (yyval.val) = 0; }
-#line 1396 "deltat.c" /* yacc.c:1646  */
+#line 1398 "deltat.c" /* yacc.c:1646  */
     break;
 
 
-#line 1400 "deltat.c" /* yacc.c:1646  */
+#line 1402 "deltat.c" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1624,7 +1626,7 @@ yyreturn:
 #endif
   return yyresult;
 }
-#line 173 "x-deltat.y" /* yacc.c:1906  */
+#line 175 "x-deltat.y" /* yacc.c:1906  */
 
 
 #ifdef __GNUC__
diff --git a/src/lib/krb5/krb/x-deltat.y b/src/lib/krb5/krb/x-deltat.y
index f9cc2bb..38231a5 100644
--- a/src/lib/krb5/krb/x-deltat.y
+++ b/src/lib/krb5/krb/x-deltat.y
@@ -44,8 +44,10 @@
 #ifdef __GNUC__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wuninitialized"
+#ifndef __clang__
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
+#endif
 
 #include "k5-int.h"
 #include <ctype.h>


More information about the cvs-krb5 mailing list