Skip to contentSkip to conversation

disas/arm-a64: Add missing compiler attribute GCC_FMT_ATTR

PATCH Applied Stefan Weil 2 participants 3 messages Jul 18, 2015 – Jul 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disas/arm-a64: Add missing compiler attribute GCC_FMT_ATTR

Type fprintf_function which fits here was defined with this attribute.

---

This is an optional trivial patch for 2.4 which fixes compiler warnings in my build environment (with -Wextra).

 disas/arm-a64.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
disas/arm-a64.cc +2 -2
index b0803f9..b57256b 100644
@@ -42,7 +42,7 @@ public:
         stream_ = stream;
     }
 
-    void SetPrintf(int (*printf_fn)(FILE *, const char *, ...)) {
+    void SetPrintf(fprintf_function printf_fn) {
         printf_ = printf_fn;
     }
 
@@ -53,7 +53,7 @@ protected:
     }
 
 private:
-    int (*printf_)(FILE *, const char *, ...);
+    fprintf_function printf_;
     FILE *stream_;
 };
 
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Stefan Weil

Type fprintf_function which fits here was defined with this attribute.

---

This is an optional trivial patch for 2.4 which fixes compiler warnings in my build environment (with -Wextra).

No objection if you want to put it in 2.4, though I'm a bit surprised that missing GCC_FMT_ATTR provokes warnings. The cleanup is nice anyway.

thanks
-- PMM

#2 lore raw
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Stefan Weil

Type fprintf_function which fits here was defined with this attribute.

---

Quoted 8 lines
Quoted 2 lines

This is an optional trivial patch for 2.4 which fixes compiler warnings in my build environment (with -Wextra).

No objection if you want to put it in 2.4, though I'm a bit surprised that missing GCC_FMT_ATTR provokes warnings. The cleanup is nice anyway.

I've applied this to target-arm.next. Thanks.

-- PMM