c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
14 stars 1 forks source link

Header generator AWK breaks on multi-line function declarators #126

Closed MattWindsor91 closed 5 years ago

MattWindsor91 commented 5 years ago

Example:

// <!> Auto-generated from a litmus test by act.
#include <stdatomic.h>
void
P0_body(atomic_int *DvYDE1WZw3C, atomic_int *TQNtLh, atomic_int *oEYk5TqzaKn,
        int *omSuP4xABT1, atomic_int *wSX0Ltjx9S, int *x, int *r0)
{
    *x = 1;
    *r0 = *x;
    atomic_store_explicit(TQNtLh, *x, memory_order_release);
    atomic_store_explicit(DvYDE1WZw3C, *x, memory_order_seq_cst);
    atomic_store_explicit(oEYk5TqzaKn, *omSuP4xABT1, memory_order_seq_cst);
    atomic_store_explicit(wSX0Ltjx9S, 49, memory_order_relaxed);
}

When I made the awk file, I assumed that the delitmus pass would never create declarators spanning multiple lines, but apparently I was wrong, and it'd be nicer to fix the AWK than to force the delitmus emitter to keep it on one line.