format-security-attribute-4.m [plain text]
/* APPLE LOCAL file radar 5096648 */
#import <CoreFoundation/CFString.h>
/* Test for implementation of (__format__ (__CFString__, m, n)) attribute */
/* { dg-options "-Wformat -Wformat-security" } */
/* { dg-do compile { target *-*-darwin* } } */
#define SECURITY_ATTR __attribute__ ((__format__ (__CFString__, 2, 6)))
typedef long CFInteger;
void CFGetAlertPanel(CFStringRef title, CFStringRef msgFormat,
CFStringRef defaultButton, CFStringRef alternateButton, CFStringRef otherButton, ...) SECURITY_ATTR;
CFInteger CFRunAlertPanel(CFStringRef title, CFStringRef msgFormat, CFStringRef defaultButton, CFStringRef alternateButton, CFStringRef otherButton, ...) SECURITY_ATTR;
int d;
const char *string;
int main()
{
CFStringRef foo;
CFGetAlertPanel (CFSTR ("foo CFGetAlertPanel (CFSTR ("foo is
CFRunAlertPanel(CFSTR ("title CFSTR ("otherButton CFRunAlertPanel(CFSTR ("title CFSTR ("otherButton
}