katef / libfsm

DFA regular expression library & friends
BSD 2-Clause "Simplified" License
931 stars 52 forks source link

-Werror, long overdue #423

Closed katef closed 1 year ago

katef commented 1 year ago

I don't like the casts to (void) for unused parser attributes (which become variables in SID's generated C), usually by way of an explicit ! directive (meaning to ignore a value):

    /*
     * The (void) casts on output parameters that are unused in some dialects.
     * This keeps gcc from complaining about generated variables that are
     * assigned a value but not used, without disabling the warning in general.
     */

One problem is C is abstracted from whatever the output language's types are, so it can't cast these itself. I thought about having SID output a macro like UNUSED(...) which we could define in the .act file to suit our types. But I'm not confident that this would cover all situations here, and I'm more interested in getting -Werror in place first.