-Wno-padded \
-Wno-undef \
-Wno-conditional-uninitialized \
- -Wno-missing-noreturn \
- -Wno-ignored-qualifiers \
-Wno-format-nonliteral
endif
* Assembly text processing: this handles the internal collection
* of text to allow parsing and assemblation.
*/
-static char *const asm_getline(size_t *byte, FILE *fp) {
+static char* asm_getline(size_t *byte, FILE *fp) {
char *line = NULL;
size_t read = util_getline(&line, byte, fp);
*byte = read;
( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn
/* It must not be possible to get here. */
-static void _ast_node_destroy(ast_node *self)
+static GMQCC_NORETURN void _ast_node_destroy(ast_node *self)
{
fprintf(stderr, "ast node missing destroy()\n");
abort();
# define GMQCC_INLINE inline
#endif
+/*
+ * noreturn is present in GCC and clang
+ * it's required for _ast_node_destory otherwise -Wmissing-noreturn
+ * in clang complains about there being no return since abort() is
+ * called.
+ */
+#if (defined(__GNUC__) && __GNUC__ >= 2) || defined(__CLANG__)
+# define GMQCC_NORETURN __attribute__ ((noreturn))
+#else
+# define GMQCC_NORETURN
+#endif
+
/*
* stdint.h and inttypes.h -less subset
* for systems that don't have it, which we must
typedef struct { char *name, type; } argitem;
VECTOR_MAKE(argitem, items);
-static const int usage(const char *const app) {
+static int usage(const char *app) {
printf("usage:\n"
" %s -c<file> -oprog.dat -- compile file\n"
" %s -a<file> -oprog.dat -- assemble file\n"