Sudhindra kulkarni via llvm-dev
2019-Apr-30 09:33 UTC
[llvm-dev] Overriding macro values defined in source code
Hi Team,
Consider the below C code,
#define AVAL 5
void func()
{
int a=5;
if(a==AVAL)
{
//Do something
}
else
{
//Do something else
}
}
My question is
Is it possible to override the value of AVAL through the -D option?
For eg is it possible to set the value of AVAL to 2 through -D in clang ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190430/8abf28d9/attachment.html>
Tim Northover via llvm-dev
2019-May-01 10:18 UTC
[llvm-dev] Overriding macro values defined in source code
On Tue, 30 Apr 2019 at 22:28, Sudhindra kulkarni via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Is it possible to override the value of AVAL through the -D option? > For eg is it possible to set the value of AVAL to 2 through -D in clang ?This is more a question for the cfe-users list, but as far as I know there's no way to prevent redefinitions in source files. Cheers. Tim.