Project

General

Profile

Actions

Bug #1056

closed

master-2013-12-02: zero length structs aren't allowed in C

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

Background:
http://stackoverflow.com/questions/755305/empty-structure-in-c

tl;dr: Empty structs aren't allowed in C. Causes compiler to error.

--- ../../suricata-master.orig/src/decode-icmpv4.h 2013-12-01 21:37:52.000000000 1100
++ decode-icmpv4.h 2013-12-03 15:07:14.661696076 +1100
@ -281,6 +281,7 @
ICMPV4_GET_TYPE((p)) == ICMP_PARAMETERPROB)

typedef struct ICMPV4Cache_ {
+ int dummy;
} ICMPV4Cache;
void DecodeICMPV4RegisterTests(void);
--- ../../suricata-master.orig/src/decode-udp.h 2013-12-01 21:37:52.000000000 1100
++ decode-udp.h 2013-12-03 11:55:39.756816544 +1100
@ -46,6 +46,7 @
typedef struct UDPVars_
{
+ int dummy;
} UDPVars;
#define CLEAR_UDP_PACKET(p) do { \
--- ../../suricata-master.orig/src/source-pcap.h 2013-12-01 21:37:52.000000000 1100
++ source-pcap.h 2013-12-03 11:55:21.803988067 +1100
@ -39,6 +39,7 @
/* per packet Pcap vars */
typedef struct PcapPacketVars_ {
+ int dummy;
} PcapPacketVars;
/** needs to be able to contain Windows adapter id's, so
--- ../../suricata-master.orig/src/util-mpm-b2gc.h 2013-12-01 21:37:52.000000000 1100
++ util-mpm-b2gc.h 2013-12-04 16:20:44.650633645 1100
@ -143,6 +143,8 @
uint32_t stat_loop_no_match;
uint32_t stat_num_shift;
uint32_t stat_total_shift;
#else
+ uint32_t dummy;
#endif /* B2GC_COUNTERS */
} B2gcThreadCtx;
Actions #1

Updated by Mark Solaris over 10 years ago

Delete this one as a dupe, it's got rubbish formatting.

Actions #2

Updated by Andreas Herz over 8 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF