We weren't setting a C++ version for build previously, which would
result in compiler specific default being used, most likely C++11
with GNU extensions on modern compilers and C++03 with GNU exts
on old compilers. This is bad because it potentially breaks build
on older toolchains that don't default to a modern C++.
Now we enable pure C++11 without GNU exts; this resulted in some
of the build breaking because of use of typeof() GNU C/C++ ext
in tests code, so fix that to use standard decltype() from C++11.
@fix
cnp mode type was a mess. thankfully it was a bit simpler than it
seemed. cleaned up code to deal with it sanely and keep it a single
type as intended byt he api too.
so gcc likes to warn even if the truncation is intended. there are
verious ways around this, but in this case it's really just writing
your own ... which is pretty simple.
there is just too much warning noise for efl.
using strncpy with strlen of the string you append is pointless.
again... strcpy will do - but use memcpy to be exact and pre-compute
sizing etc. only once. fixes warnings.
warnings now are being super picky with:
../src/modules/evas/engines/software_x11/evas_xlib_buffer.c: In
function ‘evas_software_xlib_x_output_buffer_new’:
../src/modules/evas/engines/software_x11/evas_xlib_buffer.c:306:56:
warning: cast between incompatible function types from ‘void
(*)(Display *, XErrorEvent *)’ {aka ‘void (*)(struct _XDisplay *,
struct <anonymous> *)’} to ‘int (*)(Display *, XErrorEvent *)’ {aka
‘int (*)(struct _XDisplay *, struct <anonymous> *)’}
[-Wcast-function-type]
ph = XSetErrorHandler((XErrorHandler)
can we really match a struct <anonymous> somehow? i don't think so...
so... void to the rescue.
another case of blind strncat usage rthat seemingly did a:
strcat(buf, str); -> strncat(buf, str, strlen(tr));
which is the most pointless thing to do ever. it's no better. it's
worse as it makes it harder to identify issues. thanks these days
compilers warn about this as a stupid thing to do... so i looked at it
and fixed it properly.
again - don't do this stuff above - it's pointless. patches that do
this should be rejected. fix it properly or leave it as-is.