Actions
Bug #1050
closedmaster-2013-12-02: __attribute__ ((warn_unused_result)) is a GCCism
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Affected Versions:
Effort:
Difficulty:
Label:
Description
Solaris 11 SPARC 64
Sun Studio 12.3 compiler
When compiling suricata master:
"decode.h", line 836: warning: attribute "warn_unused_result" is unknown, ignored
tcpdump had the same issue, they used a few #defines to test to see if it's ok to include those directives.
https://github.com/the-tcpdump-group/tcpdump/issues/345
The tcpdump configure.in from line
https://github.com/the-tcpdump-group/tcpdump/blob/master/configure#L3564
through to line 3778 has a lot of useful code on how to check whether to use these.
For now I'll comment it out using:
--- decode.h.orig 2013-12-03 12:18:13.646028666 1100
++ decode.h 2013-12-03 12:18:16.539558433 +1100
@ -833,7 +833,11
@
int DecodePPP(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
int DecodePPPOESession(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
int DecodePPPOEDiscovery(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
+#if !defined(SUNPRO_C)
int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *, uint8_t) __attribute ((warn_unused_result));
+#else
+int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *, uint8_t);
+#endif
int DecodeRaw(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
int DecodeIPV4(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
int DecodeIPV6(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
Updated by Mark Solaris over 10 years ago
That's annoying..
There's two underlines before SUNPRO_C, but redmine is messing them up.
Updated by Mark Solaris over 10 years ago
Let's try...
--- decode.h.orig 2013-12-03 12:18:13.646028666 +1100 +++ decode.h 2013-12-03 12:18:16.539558433 +1100 @@ -833,7 +833,11 @@ int DecodePPP(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodePPPOESession(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodePPPOEDiscovery(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); +#if !defined(__SUNPRO_C) int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *, uint8_t) __attribute__ ((warn_unused_result)); +#else +int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *, uint8_t) __attribute__ ((warn_unused_result)); +#endif int DecodeRaw(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodeIPV4(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodeIPV6(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
Updated by Mark Solaris over 10 years ago
--- decode.h.orig 2013-12-03 12:18:13.646028666 +1100 +++ decode.h 2013-12-03 12:18:16.539558433 +1100 @@ -833,7 +833,11 @@ int DecodePPP(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodePPPOESession(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodePPPOEDiscovery(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); +#if !defined(__SUNPRO_C) int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *, uint8_t) __attribute__ ((warn_unused_result)); +#else +int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *, uint8_t) __attribute__ ((warn_unused_result)); +#endif int DecodeRaw(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodeIPV4(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *); int DecodeIPV6(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
Updated by Victor Julien over 10 years ago
Mark Solaris wrote:
One could grow to hate this thing...
You have to use lowercase pre tags.
Actions