nelhage / llama

Apache License 2.0
584 stars 24 forks source link

Add warning filter configurations #40

Open jpeach opened 3 years ago

jpeach commented 3 years ago

It would be really convenient if I could specify compiler warning filters in the llama configuration since sometimes it's really hard do pass the right flags through build systems, and warnings tend to be fragile across compilers and versions of compilers.

One common use case is to force warnings off, so a config like this would be amazing:

disable-warnings:
- unused-command-line-argument # emits "-Wno-unused-command-line-argument"

The second use case is to completely filter out warnings so that compilers don't error out when they see them:

filter-warnings:
- maybe-uninitialized # both "-Wmaybe-uninitialized" and "-Wno-maybe-uninitialized" are removed
- packed-not-aligned