platform_system_core/include
Nick Kralevich 58ba58a97c logd: Don't embed a flexible array member within another struct
C (but not C++) has a concept of a flexible array member, which
is documented at https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html .
Using a flexible array member indicates that the structure is
really a header for a variable length object.

In logd's case, the variable length structure android_event_string_t
was embedded within another structure called
android_log_event_string_t. This makes gcc's __builtin_object_size()
function really confused. When compiling with C++,
__builtin_object_size(android_log_event_string_t.payload.data, 1)
would return 0, whereas if you compiled the code with C, the same
call would (properly) return -1.

Code which does automatic bounds checking, such as the proposed
patch at https://android-review.googlesource.com/145411 , will
cause problems for logd if this syntax is used.

Don't try to embed a variable length structure within another
structure. This doesn't appear to be valid C nor C++, and
while it's worked, it seems problematic.

Instead, inline the structure so it's one big happy structure.

Change-Id: I8ac02b7142a4f6560f5f80df2effcf720f9896fc
2015-04-07 10:12:20 -07:00
..
android log: Fix warning with __USE_MINGW_ANSI_STDIO 2014-06-12 13:19:51 -07:00
backtrace Refactor the code. 2015-03-31 10:51:44 -07:00
cutils Just use snprintf for android_get_control_socket. 2015-04-02 17:42:56 -07:00
diskconfig diskconfig: Add missing include for loff_t 2012-07-23 16:11:59 -07:00
log liblog: add pstore read 2015-02-26 06:37:35 -08:00
memtrack Moves libmemtrack header to standard location 2013-09-23 18:42:41 -07:00
mincrypt Add support for ECDSA P-256 with SHA256 2013-10-09 17:04:50 -07:00
nativebridge Handle code_cache dir creation in libnativebridge 2014-10-27 15:37:32 +00:00
netutils Revert "Remove netcfg's unused options." 2015-02-03 19:56:35 +00:00
private logd: Don't embed a flexible array member within another struct 2015-04-07 10:12:20 -07:00
system DO NOT MERGE Add ANativeWindow dataSpace; update graphics formats, color spaces 2015-03-19 13:19:48 -07:00
sysutils Extend to receive NFLOG packets. 2015-01-15 12:50:59 -08:00
usbhost libusbhost: Add usb_device_set_configuration and usb_device_set_interface 2014-01-13 09:54:13 -08:00
utils Only Windows doesn't have %zd. 2015-04-03 12:53:36 -07:00
ziparchive Add close_file flag to OpenArchiveFd() 2015-01-30 17:57:13 -08:00