A couple compound literals, designated initializers, and trailing
commas in enum declarations remain in the test suite. This is not
needed, we can use C89 syntax easily here.
-Subproject commit b045c0c5e35a1558e6b77d99e0ed8ab86d6dc550
+Subproject commit aaaacebf1f04c364803f308c3b3e9670e216da09
/*
* Generate random C declarations for testing.
/*
* Generate random C declarations for testing.
- * Copyright © 2012, 2022-2023 Nick Bowler
+ * Copyright © 2012, 2022-2024 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
GEN_NO_FUNCTION = 0x01,
GEN_NO_STORAGE = 0x02,
GEN_NO_VOID = 0x04,
GEN_NO_FUNCTION = 0x01,
GEN_NO_STORAGE = 0x02,
GEN_NO_VOID = 0x04,
- GEN_ONLY_REGISTER = 0x08,
+ GEN_ONLY_REGISTER = 0x08
- print "static inline struct cdecl_declspec *"
- print "gen_raw_typespec_(unsigned type, struct cdecl_declspec *next)\n{"
- print "\tstruct cdecl_declspec *s = malloc_nofail(sizeof *s);"
- print "\t*s = (struct cdecl_declspec) { .next = next, .type = type };"
+ print "static inline struct cdecl_declspec *";
+ print "gen_raw_typespec_(unsigned type, struct cdecl_declspec *next)\n{";
+ print "\tstruct cdecl_declspec *s = malloc_nofail(sizeof *s);";
+ print "\ts->type = type;";
+ print "\ts->next = next;";
+ print "\ts->ident = 0;";
print "\treturn s;\n}\n"
print "static inline struct cdecl_declspec *"
print "\treturn s;\n}\n"
print "static inline struct cdecl_declspec *"
};
static void print_usage(FILE *f)
};
static void print_usage(FILE *f)
unsigned flags = 0;
decl = malloc_nofail(sizeof *decl);
unsigned flags = 0;
decl = malloc_nofail(sizeof *decl);
- *decl = (struct cdecl) { 0 };
decl->declarators = gen_declarators(rng);
if (decl->declarators->type != CDECL_DECL_FUNCTION)
decl->declarators = gen_declarators(rng);
if (decl->declarators->type != CDECL_DECL_FUNCTION)