Bug 389049 - The C expression doesn't return a C type for integer constants
Summary: The C expression doesn't return a C type for integer constants
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: 1.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.1   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-07 08:34 EDT by Benoit Perrin CLA
Modified: 2013-06-05 04:40 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benoit Perrin CLA 2012-09-07 08:34:11 EDT
As describe by C reference books, the C defines default types for integer constants. From http://publications.gbdirect.co.uk/c_book/chapter2/constants.html

"The Standard has now invented a new way of working out what type an integer constant is. In the old days, if the constant was too big for an int, it got promoted to a long (without warning). Now, the rule is that a plain decimal constant will be fitted into the first in this list

int   long   unsigned long

that can hold the value.

Plain octal or hexadecimal constants will use this list

int   unsigned int   long   unsigned long

If the constant is suffixed by u or U:

unsigned int   unsigned long

If it is suffixed by l or L:

long   unsigned long

and finally, if it suffixed by both u or U and l or L, it can only be an unsigned long."

The C expression evaluator of the TCF agent doesn't stick to this standard and none C type is returned.
Comment 1 Eugene Tarassov CLA 2012-10-09 15:49:04 EDT
Fixed.
Thanks!
Comment 2 Jean-Michel Pedrono CLA 2012-10-10 09:50:29 EDT
Following this fix, it is no longer to add a watchpoint by address while it works fine by symbol.
Reverting this fix resolves the issue I'm facing:

git revert 76d7a3c7f1f9ad216e8e560dc2dea5771f12826f
Finished one revert.
[detached HEAD 043651a] Revert "Bug 389049 - The C expression doesn't return a C
type for integer constants"
  2 files changed, 52 insertions(+), 190 deletions(-)


I've created a new Bug:
   391552 : Regression: No longer possible to add watchpoint with address