- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page