extern void tformat__scanf__ (const char *, ...) __attribute__((format(gnu_attr___scanf__, 1, 2))); extern void tformatstrftime (const char *) __attribute__((format(gnu_attr_strftime, 1, 0))); extern void tformat__strftime__ (const char *) __attribute__((format(gnu_attr___strftime__, 1, 0))); extern void tformatstrfmon (const char *, ...) __attribute__((format(strfmon, 1, 2))); extern void tformat__strfmon__ (const char *, ...) __attribute__((format(__strfmon__, 1, 2))); extern void t__format__printf (const char *, ...) __attribute__((__format__(gnu_attr_printf, 1, 2))); extern void t__format____printf__ (const char *, ...) __attribute__((__format__(gnu_attr___printf__, 1, 2))); extern void t__format__scanf (const char *, ...) __attribute__((__format__(gnu_attr_scanf, 1, 2))); extern void t__format____scanf__ (const char *, ...) __attribute__((__format__(gnu_attr___scanf__, 1, 2))); extern void t__format__strftime (const char *) __attribute__((__format__(gnu_attr_strftime, 1, 0))); extern void t__format____strftime__ (const char *) __attribute__((__format__(gnu_attr___strftime__, 1, 0))); extern void t__format__strfmon (const char *, ...) __attribute__((__format__(strfmon, 1, 2))); extern void t__format____strfmon__ (const char *, ...) __attribute__((__format__(__strfmon__, 1, 2))); extern char *tformat_arg (const char *) __attribute__((format_arg(1))); extern char *t__format_arg__ (const char *) __attribute__((__format_arg__(1))); void foo (int i, int *ip, double d) { tformatprintf ("%d", i); tformatprintf ("%"); /* { dg-warning "format" "attribute format printf" } */ tformat__printf__ ("%d", i); tformat__printf__ ("%"); /* { dg-warning "format" "attribute format __printf__" } */ tformatscanf ("%d", ip); tformatscanf ("%"); /* { dg-warning "format" "attribute format scanf" } */ tformat__scanf__ ("%d", ip); tformat__scanf__ ("%"); /* { dg-warning "format" "attribute format __scanf__" } */ tformatstrftime ("%a"); tformatstrftime ("%"); /* { dg-warning "format" "attribute format strftime" } */ tformat__strftime__ ("%a");
extern __attribute__((__nothrow__)) int *__errno_location(void) __attribute__((__leaf__, __const__)) ; extern __attribute__((__nothrow__)) void free(void *__ptr ) __attribute__((__leaf__)) ; extern __attribute__((__nothrow__)) int atexit(void (*__func)(void) ) __attribute__((__nonnull__(1), __leaf__)) ; extern __attribute__((__nothrow__, __noreturn__)) void exit(int __status ) __attribute__((__leaf__)) ; extern void qsort(void *__base , size_t __nmemb , size_t __size , int (*__compar)(void const * , void const * ) ) __attribute__((__nonnull__(1,4))) ; extern char const *Version ; extern __attribute__((__nothrow__)) unsigned short const **__ctype_b_loc(void) __attribute__((__leaf__, __const__)) ; __inline static unsigned char to_uchar(char ch ) { { return ((unsigned char )ch); } } extern __attribute__((__nothrow__)) char *setlocale(int __category , char const *__locale ) __attribute__((__leaf__)) ; extern __attribute__((__nothrow__)) char *gettext(char const *__msgid ) __attribute__((__leaf__, __format_arg__(1))) ; extern __attribute__((__nothrow__)) char *textdomain(char const *__domainname ) __attribute__((__leaf__)) ; extern __attribute__((__nothrow__)) char *bindtextdomain(char const *__domainname , char const *__dirname ) __attribute__((__leaf__)) ; extern __attribute__((__noreturn__)) void xalloc_die(void) ; extern void *xzalloc(size_t s ) __attribute__((__malloc__, __alloc_size__(1))) ; extern char *xstrdup(char const *str ) __attribute__((__malloc__)) ; extern void *x2nrealloc(void *p , size_t *pn , size_t s ) ; extern char *last_component(char const *file ) ; extern void close_stdout(void) ; extern void version_etc(FILE *stream , char const *command_name , char const *package , char const *version , ...) __attribute__((__sentinel__)) ; extern char const *program_name ; extern void set_program_name(char const *argv0 ) ; __inline static void emit_ancillary_info(void) { char *tmp ; char *tmp___0 ; char *tmp___1 ;
__strsep_2c (char **__s, char __reject1, char __reject2) { } typedef struct stack_st { } STACK; typedef struct asn1_string_st ASN1_BIT_STRING; typedef struct bn_mont_ctx_st BN_MONT_CTX; typedef struct evp_cipher_st EVP_CIPHER; typedef struct EDIPartyName_st { union { } d; } GENERAL_NAME; typedef struct DIST_POINT_NAME_st { union { } name; } DIST_POINT_NAME; typedef struct SXNET_st { } NOTICEREF; typedef struct GENERAL_SUBTREE_st { } X509_PURPOSE; int X509V3_add_value(const char *name, const char *value, STACK **extlist); int X509_PURPOSE_add(int id, int trust, int flags, char *name, char *sname, void *arg); extern char *dcgettext (__const char *__domainname, __const char *__msgid, int __category) __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); enum { __LC_CTYPE = 0, }; struct lconv { }; typedef enum gftp_logging_level_tag { gftp_logging_send, } gftp_logging_level; struct gftp_file_tag { char *file, *destfile; unsigned int selected : 1, is_fd : 1; gint32 ipv4_network_address, ipv4_netmask; } gftp_proxy_hosts; typedef enum { gftp_option_type_text = 0, } gftp_option_type_enum; typedef struct gftp_config_list_vars_tag { } gftp_config_list_vars; typedef struct gftp_config_vars_tag { } gftp_config_vars; typedef struct gftp_option_type_tag { int (*read_function) (char *str, gftp_config_vars * cv, int line); int (*write_function) (gftp_config_vars * cv, char *buf, size_t buflen, int to_config_file);
__LC_MONETARY = 4, __LC_MESSAGES = 5, __LC_ALL = 6, __LC_PAPER = 7, __LC_NAME = 8, __LC_ADDRESS = 9, __LC_TELEPHONE = 10, __LC_MEASUREMENT = 11, __LC_IDENTIFICATION = 12 }; extern int errno; static char *buf; extern const char _libc_intl_domainname[]; extern char *dcgettext (__const char *__domainname, __const char *__msgid, int __category) __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); extern char *__dcgettext (__const char *__domainname, __const char *__msgid, int __category) __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); extern void *__rawmemchr (__const void *__s, int __c) __attribute__ ((__pure__)); char * strcat (dest, src) char *dest; const char *src; { char *s1 = dest; const char *s2 = src; char c; char tmp;
/* Test for multiple format_arg attributes. Test for both branches getting checked. */ /* Origin: Joseph Myers <*****@*****.**> */ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ #include "format.h" extern char *ngettext (const char *, const char *, unsigned long int) __attribute__((__format_arg__(1))) __attribute__((__format_arg__(2))); void foo (long l, int nfoo) { printf (ngettext ("%d foo", "%d foos", nfoo), nfoo); printf (ngettext ("%d foo", "%d foos", l), l); /* { dg-warning "int format" "wrong type in conditional expr" } */ printf (ngettext ("%d foo", "%ld foos", l), l); /* { dg-warning "int format" "wrong type in conditional expr" } */ printf (ngettext ("%ld foo", "%d foos", l), l); /* { dg-warning "int format" "wrong type in conditional expr" } */ /* Should allow one case to have extra arguments. */ printf (ngettext ("1 foo", "%d foos", nfoo), nfoo); printf (ngettext ("1 foo", "many foos", nfoo), nfoo); /* { dg-warning "too many" "too many args in all branches" } */ printf (ngettext ("", "%d foos", nfoo), nfoo); printf (ngettext ("1 foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); printf (ngettext ("%ld foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int format" "wrong type" } */ printf (ngettext ("%d foo", (nfoo > 0) ? "%ld foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int format" "wrong type" } */ printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "%ld foos", nfoo), nfoo); /* { dg-warning "long int format" "wrong type" } */ }