1 /* { dg-additional-options "-fanalyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
2 /* { dg-skip-if "c++98 has no noreturn attribute" { c++98_only } } */
5 #define _Noreturn [[noreturn]]
8 typedef __SIZE_TYPE__
size_t;
9 typedef struct _IO_FILE
FILE;
10 extern char *fgets(char *__restrict __s
, int __n
, FILE *__restrict __stream
)
11 __attribute__((__access__(__write_only__
, 1, 2)));
12 extern void perror(const char *__s
);
14 _ISspace
= ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
16 extern const unsigned short int **__ctype_b_loc(void)
17 __attribute__((__nothrow__
, __leaf__
)) __attribute__((__const__
));
18 extern void *malloc(size_t __size
) __attribute__((__nothrow__
, __leaf__
))
19 __attribute__((__malloc__
)) __attribute__((__alloc_size__(1)));
20 extern void exit(int __status
) __attribute__((__nothrow__
, __leaf__
))
21 __attribute__((__noreturn__
));
22 extern char *strcpy(char *__restrict __dest
, const char *__restrict __src
)
23 __attribute__((__nothrow__
, __leaf__
)) __attribute__((__nonnull__(1, 2)));
24 extern size_t strlen(const char *__s
) __attribute__((__nothrow__
, __leaf__
))
25 __attribute__((__pure__
)) __attribute__((__nonnull__(1)));
33 static struct mydata
*all_data
;
36 _Noreturn
static void failed(const char *message
) {
41 static char *string_dup(const char *string
) {
44 if ((buf
= (char *) malloc(strlen(string
) + 1)) == ((void *)0))
45 failed("malloc() failed");
47 return strcpy(buf
, string
);
50 static void store_data(const char *name
, const char *type
) {
53 if ((p
= (struct mydata
*)malloc(sizeof(struct mydata
))) == ((void *)0))
54 failed("malloc() failed");
56 p
->link
= (struct mydata
*)((void *)0);
57 p
->name
= string_dup(name
);
58 p
->type
= string_dup(type
);
60 if ((q
= all_data
) == ((void *)0))
63 while (q
->link
!= ((void *)0))
69 static void parse_tbl(char *buffer
) {
71 char *t
= s
+ strlen(s
);
75 if (((*__ctype_b_loc())[(int)(((int)*t
))] & (unsigned short int)_ISspace
))
80 while (((*__ctype_b_loc())[(int)(((int)*s
))] & (unsigned short int)_ISspace
))
85 if (*buffer
!= ';' && *buffer
!= '\0') {
87 store_data(buffer
, ""); /* { dg-bogus "leak" "PR analyzer/107158" { xfail *-*-* } } */
90 while (*s
&& !((*__ctype_b_loc())[(int)(((int)*s
))] &
91 (unsigned short int)_ISspace
))
94 ((*__ctype_b_loc())[(int)(((int)*s
))] & (unsigned short int)_ISspace
))
96 store_data(buffer
, s
); /* { dg-bogus "leak" "PR analyzer/107158" { xfail *-*-* } } */
103 static void makecfg(FILE *ifp
, FILE *ofp
, FILE *ofp2
) {
109 while (fgets(buffer
, sizeof(buffer
) - 1, ifp
))