Bug 431863 - [checker] Codan should report an error when constant value or pre-processor value is changed or modified at the later stage in the program
Summary: [checker] Codan should report an error when constant value or pre-processor v...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: Next   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 02:44 EDT by rohit gupta CLA
Modified: 2014-06-18 20:36 EDT (History)
2 users (show)

See Also:


Attachments
here i attach a snap shot of eclipse Kepler with codan plugin (187.48 KB, image/jpeg)
2014-04-03 02:44 EDT, rohit gupta CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rohit gupta CLA 2014-04-03 02:44:03 EDT
Created attachment 241538 [details]
here i attach a snap shot of eclipse Kepler with codan plugin

In C language compiler throw error when a pre-processor or const value is changed but codan does not give any error when I change the value. codan should be0 intelligent enough to detect such type of problem.

for eg:

...
1.  #define testingvariable_1 5
2.  const int temp1 = 23;
3. 
4. 
5.  void main(void)
6.  {
7.   int temp11,temp12;
8. 
9.   puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
10. 
11.   /*It is supposed to show error here*/
12.   testingvariable_1 = 6;	/*error :lvalue can not be modify*/
13.   temp1 = 5;			/*error :lvalue can not be modify*/
14. }

.....
 
here in 1st and 2nd line i define pre-processor and constant respectively but at line number 12 and 13 it is not showing any type of problem.
but if you consider this problem in visual studio you will get an error.
please solve this problem.
Comment 1 Curtis Windatt CLA 2014-04-03 09:21:26 EDT
Moving to CDT for comment.  

However, please make better quality bug reports.  This is not a blocker severity issue.  Do not cc a large list of committers who have nothing to do with the issue.
Comment 2 rohit gupta CLA 2014-04-04 00:19:55 EDT
ok,
i will try to make better quality of bug report.
can you please give me the solution of this.
Comment 3 Alpesh Patel CLA 2014-04-04 00:27:54 EDT
Dear Curtis,

I tried this kind of code in VS2010 and found it catches this issue on the fly.....I too believe this kind of issue can be caught by codan as we code.