- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since ICC can't correctly process a .h file, is it possible to have said header file passed through VC? Using string manipulation, I can see how to have a single .cpp file compiled by VC (as shown here) but this won't work for the header files associated.
The header file:
http://mxr.mozilla.org/mozilla-release/source/xpcom/base/ErrorList.h
The errors that are produced:
c:\Development\Source\objdir\dist\include\ErrorList.h(10): error: expression must have arithmetic, enum, or pointer type
ERROR(NS_ERROR_NOT_INITIALIZED, NS_ERROR_BASE + 1),
^
c:\Development\Source\objdir\dist\include\ErrorList.h(12): error: expression must have arithmetic, enum, or pointer type
ERROR(NS_ERROR_ALREADY_INITIALIZED, NS_ERROR_BASE + 2),
^
c:\Development\Source\objdir\dist\include\ErrorList.h(42): error: expression must have arithmetic, enum, or pointer type
ERROR(NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT, NS_ERROR_BASE + 0x101),
^
c:\Development\Source\objdir\dist\include\ErrorList.h(44): error: expression must have arithmetic, enum, or pointer type ERROR(NS_ERROR_FACTORY_EXISTS, NS_ERROR_BASE + 0x100),
^
I know I reported this error before, but I didn't report on it very thoroughly, so that's my own fault. The only work around I can see if to have VC compile this file as opposed to ICC or have ICC ignore the error (which I don't think is possible).
Any ideas?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It would be best if we could get to the bottom of the error diagnostic that you see. Attach a preprocessed filed, and also include the compiler invocation where the error diagnostic is seen. To generate the preprocessed file, use the -E switch e.g. icl -E > preprocess.txt ...
it would also be helpful to know which version of visual studio you're using, and which version of the Intel compiler. Building for ia32 or intel64?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
p.s. i checked the link that you referred to. There's probably a firefox/mozilla configuration problem that's causing the problem that you see, not a compiler bug. For example, if the macro ERROR is not defined for Intel compilations. You could compare the preprocessed output from cl and icl, e.g.: cl -E ... > cl-preprocess and icl -E ... > icl-preprocess
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think macro ERROR is defined for Intel Compiler considering since I found this block in nsError.h:
142 #elif defined(__cplusplus)
143 /*
144 * We're C++ in an old compiler lacking enum classes *and* typed enums (likely
145 * gcc < 4.5.1 as clang/MSVC have long supported one or both), or compiler
146 * support is unknown. Yet nsresult must have unsigned 32-bit representation.
147 * So just make it a typedef, and implement the constants with global consts.
148 */
149 typedef uint32_t nsresult;
150
151 const nsresult
152 #undef ERROR
153 #define ERROR(key, val) key = val
154 #include "ErrorList.h"
155 #undef ERROR
156 ;
So macro gets substituted as key = value; expression. The other common macro which I find in all the above error is NS_ERROR_BASE. I wasn't able to spot the location where this macro is defined to see if this is enabled for Intel C++ Compiler.
The value for NS_ERROR_BASE is assigned at ErrorList.h:
8 ERROR(NS_ERROR_BASE, 0xC1F30000),
and this expression should evaluate to
NS_ERROR_BASE = 0xC1F30000;
But no where I could spot if NS_ERROR_BASE is a data type or a macro. The only occurences of NS_ERROR_BASE are http://mxr.mozilla.org/mozilla-release/ident?i=NS_ERROR_BASE
But like Melanie Blower said this is to do with macros not being enabled with icl. Generating the preprocessed file will surely help in narrowing down the problem.
Thanks and Regards
Anoop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The preprocessed files don't have the expected content. Can you do it again?
Find the compilation command which fails by looking in the build log. It will have many switches. Copy this line exactly, then modify to add "-E > outfile". You also need to know what directory the compilation is invoked from. cd into that directory, and issue the modified compilation line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I might have found why ICC hasn't been given a definition:
http://dxr.mozilla.org/mozilla-central/source/mfbt/TypedEnum.h
In this file we see this piece of code:
#elif defined(_MSC_VER)
# if _MSC_VER >= 1400
# define MOZ_HAVE_CXX11_ENUM_TYPE
# endif
# if _MSC_VER >= 1700
# define MOZ_HAVE_CXX11_STRONG_ENUMS
# endif
#endif
Which made me remember, the Mozilla source code doesn't support < MSVC 15 SP1 and since Mozilla treats ICC build number as MSVC (the latest version of ICC being 14, therefore an unsupported MSVC build number) that there won't be any definition for it.
So hopefully if I modify all the _MSC_VER definitions to match the ICC build number we won't have any issues! Can anyone tell me if this piece of code will overwrite the ICC build number, or will it still be recognised as 14? I know I'll have to define it in multiple configure files.
set CC=icl
set CXX=icl
set CC_VERSION=17.0.0.000
set CXX_VERSION=17.0.0.000
set LD=xilink
set AR=xilib -NOLOGO -OUT:"$@"
Sergey Kostrov wrote:
Let me go back to your original question:
>>...Since ICC can't correctly process a .h file, is it possible to have said header file passed through VC?
Yes, it is possible. However, you have a project configuration issue and this is why Intel C++ compiler can not compile the sources.
What you're trying to achive is a workaround and this is Not going to solve the problem completely. What we're trying to convince you is that you need to find and fix a root cause of the project configuration problem.
I think some #ifdef-#else-#endif statements are missing for some macro declarations and that is why Microsoft C++ compiler can compile and Intel C++ compiler can not.
Very true, I was just curious if it was possible to at least have something to work on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not just fix the header file you found to explicitly handle the intel compiler and do the right thing? That way you could also contribute a patch back to mozilla. The intel compiler defines some macros you could use to build #ifdef statements to define the proper macros for building with intel.
I'm not on windows so I cannot check the exact define flags the compiler emotes, but on linux icpc (13.x update 5) defines
-D__ICC=1310 -D__INTEL_COMPILER=1310
so at least on linux, you could add to that header file
[cpp]
#if defined( __ICC)
#if __ICC >= 1310
# define MOZ_HAVE_CXX11_ENUM_TYPE
# define MOZ_HAVE_CXX11_STRONG_ENUMS
#endif
#endif
[/cpp]
Note that I don't know what versions of icpc are required for those features and just included the current version as an example. You would put this in the header file after the checks for _MSC_VER but first verify the name of the macro the intel compiler defines on windows ( __ICC).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I'll probably end up doing that. But it doesn't seem to have worked so I'll see what else I need to modify and if the version being 14 is even the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah I would submit a patch, but even when having the source code recognize the version of ICC the error still occurs. I thought that would solve it but it hasn't, looks like I've hit a wall again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That website loads for me, but does take 30 seconds to return content.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey Kostrov wrote:
I reviewed sources and I see that there are three different declarations of ERROR enumeration. In a very small test case I did not see any problems and what I'd like to see is a complete set of command line options for Intel C++ compiler.
What do you mean by a list of command line options? And I've tried declaring the ERROR type directly in the file and the error still occurs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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