Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] error in basic type construction?

Hello,

I'm part of the team at IMEC (Belgium) developing a CDT-based tool for
cleaning C code.  I was wondering if the following is an error or not.

In the constructor CBasicType(ICASTSimpleDeclSpecifier), both the
qualifiers unsigned and longlong are set if the simple declaration
specifier is unsigned:

public CBasicType(ICASTSimpleDeclSpecifier sds) {
   this.type = sds.getType();
   this.qualifiers = ( sds.isLong() ? CBasicType.IS_LONG : 0 ) |
   ( sds.isShort() ? CBasicType.IS_SHORT : 0 ) |
   ( sds.isSigned() ? CBasicType.IS_SIGNED: 0 ) |
   ( sds.isUnsigned()? CBasicType.IS_UNSIGNED : 0 ) |
   ( sds.isUnsigned()? CBasicType.IS_LONGLONG : 0 ) |
   ( sds.isComplex() ? CBasicType.IS_COMPLEX : 0 ) |
   ( sds.isImaginary()?CBasicType.IS_IMAGINARY : 0 );
...}}

Shouldn't this be:

...
   ( sds.isUnsigned()? CBasicType.IS_UNSIGNED : 0 ) |
   ( sds.isLonglong()? CBasicType.IS_LONGLONG : 0 ) |
...


Thanks in advance and best regards,

Maja




begin:vcard
fn:Maja D'Hondt
n:D'Hondt;Maja
org:IMEC
adr:;;Kapeldreef 75;Leuven;;3001;Belgium
email;internet:maja.dhondt@xxxxxxx
tel;work:+32 (0)16 28 78 82
version:2.1
end:vcard


Back to the top