<div dir="auto"><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: "Tim Northover" <<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>><br>Date: May 1, 2019 3:48 PM<br>Subject: Re: [llvm-dev] Overriding macro values defined in source code<br>To: "Sudhindra kulkarni" <<a href="mailto:sudhindrakkulkarni102@gmail.com" target="_blank">sudhindrakkulkarni102@gmail.<wbr>com</a>><br>Cc: "LLVM Developers Mailing List" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><br type="attribution"><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Tue, 30 Apr 2019 at 22:28, Sudhindra kulkarni via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Is it possible to override the value of AVAL through the -D option?<br>
> For eg is it possible to set the value of AVAL to 2 through -D in clang ?<br>
<br>
</div>This is more a question for the cfe-users list, but as far as I know<br>
there's no way to prevent redefinitions in source files.<br>
<br>
Cheers.<br>
<font color="#888888"><br>
Tim.<br>
</font></blockquote></div><span style="font-family:sans-serif;font-size:13.696px">Hi Team,</span><div dir="auto" style="font-family:sans-serif;font-size:13.696px">                 Consider the below C code,</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">#define AVAL 5</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">void func()</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">{</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">int a=5;</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">if(a==AVAL)</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">{</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">//Do something</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">}</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">else</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">{</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">//Do something else</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">}</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px"><br></div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">}</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">My question is </div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">Is it possible to override the value of AVAL through the -D option?</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">For eg is it possible to set the value of AVAL to 2 through -D in clang so that the else part executes?</div></div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">Also apart from -D option we are also open to other ways of achieving this</div><div dir="auto" style="font-family:sans-serif;font-size:13.696px">Thanks in advance</div></div>