Update configure and src/config/pool_config.c due to the previous commit.
authorBo Peng <pengbo@sraoss.co.jp>
Tue, 10 Aug 2021 07:54:04 +0000 (16:54 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Tue, 10 Aug 2021 07:54:04 +0000 (16:54 +0900)
configure
src/config/pool_config.c

index 54f288a6d94be89670e5ea258d34540274a08312..5cbb75ef7b065ec34fdcb8662081ad893b357ee4 100755 (executable)
--- a/configure
+++ b/configure
 if test -n "$NOT_THE_CFLAGS"; then
   CFLAGS="$CFLAGS -Wno-format-truncation"
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5
+$as_echo_n "checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; }
+if ${pgac_cv_prog_CC_cflags__Wstringop_truncation+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
+pgac_save_CC=$CC
+CC=${CC}
+CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  pgac_cv_prog_CC_cflags__Wstringop_truncation=yes
+else
+  pgac_cv_prog_CC_cflags__Wstringop_truncation=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+CC="$pgac_save_CC"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wstringop_truncation" >&5
+$as_echo "$pgac_cv_prog_CC_cflags__Wstringop_truncation" >&6; }
+if test x"$pgac_cv_prog_CC_cflags__Wstringop_truncation" = x"yes"; then
+  NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
+fi
 
 
+if test -n "$NOT_THE_CFLAGS"; then
+  CFLAGS="$CFLAGS -Wno-stringop-truncation"
+fi
+
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE "$PACKAGE"
 _ACEOF
index 2286f61e108e8624e81fbbba6f982332243f0620..e916389c90671d6717b22f2d368d6cac2fc30dd2 100644 (file)
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 37
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -46,7 +46,6 @@ typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
@@ -54,7 +53,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -85,6 +83,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -332,7 +332,7 @@ void yyfree (void *  );
 
 /* Begin user sect3 */
 
-#define yywrap(n) 1
+#define yywrap() 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -358,7 +358,7 @@ static void yy_fatal_error (yyconst char msg[]  );
  */
 #define YY_DO_BEFORE_ACTION \
        (yytext_ptr) = yy_bp; \
-       yyleng = (yy_size_t) (yy_cp - yy_bp); \
+       yyleng = (size_t) (yy_cp - yy_bp); \
        (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
        (yy_c_buf_p) = yy_cp;
@@ -641,7 +641,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -652,7 +652,7 @@ static int input (void );
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
                int c = '*'; \
-               yy_size_t n; \
+               size_t n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -1069,7 +1069,7 @@ static int yy_get_next_buffer (void)
                        { /* Not enough room in the buffer - grow it. */
 
                        /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
                        int yy_c_buf_p_offset =
                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
@@ -1202,7 +1202,7 @@ static int yy_get_next_buffer (void)
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
        yy_is_jam = (yy_current_state == 39);
 
-       return yy_is_jam ? 0 : yy_current_state;
+               return yy_is_jam ? 0 : yy_current_state;
 }
 
 #ifndef YY_NO_INPUT
@@ -1253,7 +1253,7 @@ static int yy_get_next_buffer (void)
                                case EOB_ACT_END_OF_FILE:
                                        {
                                        if ( yywrap( ) )
-                                               return 0;
+                                               return EOF;
 
                                        if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
@@ -1593,8 +1593,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
 
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * @return the newly allocated buffer state object.
  */
@@ -1602,7 +1602,8 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len
 {
        YY_BUFFER_STATE b;
        char *buf;
-       yy_size_t n, i;
+       yy_size_t n;
+       yy_size_t i;
     
        /* Get memory for full buffer, including space for trailing EOB's. */
        n = _yybytes_len + 2;
@@ -1857,6 +1858,8 @@ int add_regex_pattern(const char *type, char *s)
 {
        int regex_flags = REG_NOSUB;
        RegPattern currItem;
+       int     pattern_len;
+
        /* force case insensitive pattern matching */
        regex_flags |= REG_ICASE;
        /* Add extended regex search */
@@ -1883,16 +1886,18 @@ int add_regex_pattern(const char *type, char *s)
        currItem.flag = regex_flags;
 
        /* Fill pattern array */
-       currItem.pattern = palloc(sizeof(char)*(strlen(s)+3));
+       pattern_len = sizeof(char)*(strlen(s)+3);
+       currItem.pattern = palloc(pattern_len);
+
        /* Force exact matching of function name with ^ and $ on the regex
           if required to prevent partial matching. It also allow backward
           compatibility.
         */
        if (strncmp(s, "^", 1) != 0) {
                strncpy(currItem.pattern, "^", 2);
-               strncat(currItem.pattern, s, strlen(s) + 1);
+               strncat(currItem.pattern, s, pattern_len - 2);
        } else {
-               strncpy(currItem.pattern, s, strlen(s) + 1);
+               strncpy(currItem.pattern, s, pattern_len);
        }
        if (s[strlen(s)-1] != '$') {
                strncat(currItem.pattern, "$", 2);