[PATCH 3/8] move the definition of FMT_{PRINTF,SCANF}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move these from parse.c to symbol.h so that they can be reused
when verifying the format.

Also, add a definition for unknown format type: FMT_UNKNOWN

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 parse.c  | 6 ------
 symbol.h | 7 +++++++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/parse.c b/parse.c
index 1b021b87549e..c2d29318149f 100644
--- a/parse.c
+++ b/parse.c
@@ -120,12 +120,6 @@ static void asm_modifier(struct token *token, unsigned long *mods, unsigned long
 	*mods |= mod;
 }
 
-/* the types of formatting from __attribute__((format)) */
-enum {
-	FMT_PRINTF = 0,
-	FMT_SCANF,
-};
-
 static struct symbol_op typedef_op = {
 	.type = KW_MODIFIER,
 	.declarator = storage_specifier,
diff --git a/symbol.h b/symbol.h
index 55c7e3330ec3..0d5439ee93f7 100644
--- a/symbol.h
+++ b/symbol.h
@@ -95,6 +95,13 @@ extern struct context *alloc_context(void);
 
 DECLARE_PTR_LIST(context_list, struct context);
 
+/* the types of formatting from __attribute__((format)) */
+enum {
+	FMT_UNKNOWN,
+	FMT_PRINTF,
+	FMT_SCANF,
+};
+
 struct attr_format {
 	unsigned short index;	/* index in argument list for format string */
 	unsigned short first;	/* where first variadic argument is */
-- 
2.28.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux