mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-25 01:38:33 +03:00
add printf attribute declaration to remove warning
the __attribute__ ((format (printf, 1, 0))) declaration remove the following compilation warning: warning: function 'osmo_panic' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] osmo_panic_default(fmt, args);
This commit is contained in:
@@ -43,6 +43,7 @@ static osmo_panic_handler_t osmo_panic_handler = (void*)0;
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
__attribute__ ((format (printf, 1, 0)))
|
||||||
static void osmo_panic_default(const char *fmt, va_list args)
|
static void osmo_panic_default(const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
@@ -73,6 +74,7 @@ static void osmo_panic_default(const char *fmt, va_list args)
|
|||||||
* The default function on most systems will generate a backtrace and
|
* The default function on most systems will generate a backtrace and
|
||||||
* then abort() the process.
|
* then abort() the process.
|
||||||
*/
|
*/
|
||||||
|
__attribute__ ((format (printf, 1, 0)))
|
||||||
void osmo_panic(const char *fmt, ...)
|
void osmo_panic(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|||||||
Reference in New Issue
Block a user