Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Vincent_Lefevre
Beginner
145 Views

Missing error on code with invalid preprocessing token (ICC 13.1.0)

I've tried to compile the following invalid code with ICC 13.1.0, and I get no errors:

int main(void)
{
  int i = 0x00E-0x00A;
  return 0;
}

This code is invalid because 0x00E-0x00A is a preprocessing token due to the "E-". See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3885 (GCC correctly outputs an error).

0 Kudos
2 Replies
jimdempseyatthecove
Black Belt
145 Views

If you are going to permit "E-" suffix appended to a hexadecimal integer mantissa, then by all rights you should also permit the exponent itself be expressed as a hexadecimal integer.

Therefore 0x00E-0x00A would be equivalent to 0E-10, and is not in error.

It would only seem fair to be consistent. (though stripping the E out of the hex number would seem counter intuitive).

Jim Dempsey

Amanda_S_Intel
Employee
145 Views

This was fixed in 14.0:

Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.080 Build 20130728

Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

Edison Design Group C/C++ Front End, version 4.6 (Jul 29 2013 19:04:45)
Copyright 1988-2013 Edison Design Group, Inc.

hex.c(3): error: extra text after expected end of number
    int i = 0x00E-0x00A;
                 ^

compilation aborted for hex.c (code 2)

Reply