format-parser: Fix inconsistent use of "char *" vs "char[NUMBER]".
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 1 May 2021 22:53:09 +0000 (15:53 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 1 May 2021 22:53:09 +0000 (15:53 -0700)
These are equivalent according to the C standard in function prototypes,
but GCC 11 warns about using them inconsistently between a prototype and
a definition.  This commit avoids the warning.

src/language/lexer/format-parser.c
src/language/lexer/format-parser.h

index 2ecd539b8fc1660e75f2a8cda703eb7910becb4b..906d0f327168c5508f16859f46c52c3684987334 100644 (file)
 
 #include <config.h>
 
+#include "language/lexer/format-parser.h"
+
 #include <ctype.h>
 #include <stdint.h>
 #include <stdlib.h>
 
 #include "data/format.h"
 #include "data/variable.h"
-#include "language/lexer/format-parser.h"
 #include "language/lexer/lexer.h"
 #include "libpspp/message.h"
 #include "libpspp/misc.h"
index 8704e93c477226ffc365c0559d0899ec7e029943..7601bc46b2ff9fd5c226a5985f0743dde066c423 100644 (file)
 
 #include <stdbool.h>
 
+#include "data/format.h"
+
 struct lexer;
 
-bool parse_abstract_format_specifier (struct lexer *, char *type,
+bool parse_abstract_format_specifier (struct lexer *,
+                                      char type[FMT_TYPE_LEN_MAX + 1],
                                       uint16_t *width, uint8_t *decimals);
 
 enum fmt_type ;