[PATCH] D24933: Enable configuration files in clang

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 10 20:56:46 PST 2016


sepavloff added a comment.

>> Config file set by environment variable is similar to default config file as user does not specify anything in command line. But the user must explicitly specify the file, it is not made automatically.
> 
> Sorry, I don't understand this part.

If a user specifies `clang foo.c`, the compiler driver "magically" gets additional options in both cases, whether default config file is used or the config is specified by environment variable. So both scenarios are evil to some extent. But the latter case is the lesser evil, as the user must previously define proper variable. Sorry for unclear wording.

>> Ability to append compiler options via environment variable is important feature, I think, because:
>> ...
>> 
>> - Build systems provided by software components are not perfect. Some do not honor CFLAGS, some require setting options inside makefiles etc. Changing compiler options might be a challenge. Environment variable solves this problem easily and effectively.
> 
> But now you seem to be serving the goal about letting the user set flags without using the build system, which I thought wasn't a goal anymore?

Strictly speaking, you are right. Setting config by environment variable has the same effect as using default config file, with the exception that compiler user deliberately sets the variable and can chose what options to set in a particular case. By allowing this "lesser evil" we provide the user with a way to work around complex cases.


https://reviews.llvm.org/D24933





More information about the cfe-commits mailing list