larmel / lacc

A simple, self-hosting C compiler
MIT License
872 stars 64 forks source link

The -W flag means -Wextra #21

Closed ibara closed 4 years ago

ibara commented 4 years ago

Hi --

The -W flag is a (allegedly deprecated) synonym for -Wextra. Both gcc and clang recognize -W. lacc however will complain that -W is missing an argument. This PR teaches lacc about -W. It still may be the case that -Wextra gets ignored for now, but that's preferable to a compiler error.

larmel commented 4 years ago

This change made me realize that the option parsing code does not need to support "flags", allowing things like -Sv to mean assembly plus verbose. Removing that functionality, we can add -W as a normal option instead of hacking argparse.c