eal: introduce portable format attribute
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Thu, 27 Feb 2020 04:25:31 +0000 (07:25 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 18 Mar 2020 00:19:16 +0000 (01:19 +0100)
commitabc61614f8968b436e3539bef3a608b860c9e0c4
treed03223c92975699593f9152b7759e4872b111f1d
parent0c9a5735a9479e8b6c05580efdbd15ae00869edf
eal: introduce portable format attribute

When using __attribute__((format(...)) on functions, GCC on Windows
assumes MS-specific format string by default, even if the underlying
stdio implementation is ANSI-compliant (either MS Unicersal CRT
or MinGW implementation). Wrap attribute into a macro that forces
GNU-specific format string when using GCC.

Use this new attribute for logging and panic messages in EAL
and for output strings in cmdline library.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: William Tu <u9012063@gmail.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
lib/librte_cmdline/cmdline.h
lib/librte_eal/common/include/rte_common.h
lib/librte_eal/common/include/rte_debug.h
lib/librte_eal/common/include/rte_devargs.h
lib/librte_eal/common/include/rte_log.h