Project

General

Profile

Actions

Bug #1050

closed

master-2013-12-02: __attribute__ ((warn_unused_result)) is a GCCism

Added by Mark Solaris over 10 years ago. Updated over 8 years ago.

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 *);
Actions

Also available in: Atom PDF