On Jul 10, 2015, at 02:57 PM, "Jan E. Schotsman" <[email protected]> wrote:

How can I get rid of warnings about unsafe use of printf?

char myString[256];

// set myString in some untransparent way

printf( myString ); // warning: format string is not a literalĀ 

Temporarily turn off the warning:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
printf(myString);
#pragma GCC diagnostic pop

Better yet, don't do that, *because it's potentially insecure*. Just do this 
instead:

printf("%s", myString);

Sent from iCloud (got I hate this editor)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to