- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
//name: h.cpp:
//----------------------------------------
#include
#include
#include
//actually no other codes
-----------------------------------------
compiler option:
icl.exe -c -Od -Zi W3 -GF -EHsc -Gy -Gd -Fo"Debug/" -Fd"Debug/" -D "_AFXDLL" -MD -D "WIN32" -D "_MBCS" -D "_CONSOLE" h.cpp
Intel C++ Compiler for 32-bit applications, Version 7.1 Build 20030307Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
Can someone explains why?
Also is it possible for the compiler to generate
errors instead of warning messages, for the pointer conversions like:
const char *q;
char *q1 = q; // generates only warning here
int *p = q1; // generates only warning here
Thanks in advance.
- xin
//----------------------------------------
#include
#include
#include
//actually no other codes
-----------------------------------------
compiler option:
icl.exe -c -Od -Zi W3 -GF -EHsc -Gy -Gd -Fo"Debug/" -Fd"Debug/" -D "_AFXDLL" -MD -D "WIN32" -D "_MBCS" -D "_CONSOLE" h.cpp
Intel C++ Compiler for 32-bit applications, Version 7.1 Build 20030307Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
Can someone explains why?
Also is it possible for the compiler to generate
errors instead of warning messages, for the pointer conversions like:
const char *q;
char *q1 = q; // generates only warning here
int *p = q1; // generates only warning here
Thanks in advance.
- xin
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wasn't able to reproduce the crash, but I think I have an answer for your second question.
If you'll note, the warning that you would like to change to an error is this:
t.cpp(2): warning #144: a value of type "const char *" cannot be used to initialize an entity of type "char *"
On Windows, you can turn this warning into an error by adding the -Qwe144 switch. Note that I used 144 for "warning #144".
On Linux, you can do the same thing with -we144
icl -help will describe these options.
-Jeff
If you'll note, the warning that you would like to change to an error is this:
t.cpp(2): warning #144: a value of type "const char *" cannot be used to initialize an entity of type "char *"
On Windows, you can turn this warning into an error by adding the -Qwe144 switch. Note that I used 144 for "warning #144".
On Linux, you can do the same thing with -we144
icl -help will describe these options.
-Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot!
For the first problem I found even there is only one include the compiler will crash in my system:
//h.cpp
#include
// no other code
icl -c -Od -Zi -W3 -GF -EHsc -Gy -Gd -D "_AFXDLL" -MD -D "WIN32" -D "_MBCS" -D "_CONSOLE"
h.cpp
Intel C++ Compiler for 32-bit applications, Version 7.1 Build 20030307Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
h.cpp
C:Program FilesMicrosoft Visual Studio .NETVc7INCLUDExlocnum(1129): (col. 37)internal error: assertion failed at: "proton/edgglue/edg_main.c", line 593
I also found it went through without any problem if I remove one of the three flags, -MD or -Zi or -Od.
- xin
For the first problem I found even there is only one include the compiler will crash in my system:
//h.cpp
#include
// no other code
icl -c -Od -Zi -W3 -GF -EHsc -Gy -Gd -D "_AFXDLL" -MD -D "WIN32" -D "_MBCS" -D "_CONSOLE"
h.cpp
Intel C++ Compiler for 32-bit applications, Version 7.1 Build 20030307Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
h.cpp
C:Program FilesMicrosoft Visual Studio .NETVc7INCLUDExlocnum(1129): (col. 37)internal error: assertion failed at: "proton/edgglue/edg_main.c", line 593
I also found it went through without any problem if I remove one of the three flags, -MD or -Zi or -Od.
- xin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Really only 2 switches are required for this assertion
-MD and any one from the list -Zi -ZI -Z7
So assertion requirements:
1. using STD lib from MSVC7.0
2. using dynamic RTL version
3. request for debug symbols included.
-MD and any one from the list -Zi -ZI -Z7
So assertion requirements:
1. using STD lib from MSVC7.0
2. using dynamic RTL version
3. request for debug symbols included.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try the combo of "-O1 -Zi -MD" ?
Anyway, do you think it is a bug from icl?
Anyway, do you think it is a bug from icl?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, surely. I can open the corresponding issue in the Intel Support. BTW, it is not the only bug in icl dealing with locales.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wanted to add that I think this is fixed in W_CC_PU_7.1.010 available on Premier Support (https://premier.intel.com).
Brandon
Intel Developer Support
For on-line assistance: http://support.intel.com/support/performancetools
For product support information: http://www.intel.com/software/products/support
* Intel and Pentium are registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries
* Other names and brands may be claimed as the property of others
Brandon
Intel Developer Support
For on-line assistance: http://support.intel.com/support/performancetools
For product support information: http://www.intel.com/software/products/support
* Intel and Pentium are registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries
* Other names and brands may be claimed as the property of others
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found a workaround for the first problem.
It uses the undocumented MS linker switch /alternatename.
This switch can be added in the additional linker options (1),
or into source code via #pragma comment(linker, "...") (2).
(1)
In the linker options, add:
/alternatename:__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z=__imp_??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
or
(2)
In one of your sources, after the includes, write:
#pragma comment(linker, "/alternatename:__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z=__imp_??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z")
It uses the undocumented MS linker switch /alternatename.
This switch can be added in the additional linker options (1),
or into source code via #pragma comment(linker, "...") (2).
(1)
In the linker options, add:
/alternatename:__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z=__imp_??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
or
(2)
In one of your sources, after the includes, write:
#pragma comment(linker, "/alternatename:__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z=__imp_??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am also facing a similar problem wherein my code crashes when I use any of the optimization options lile /O3 /Og etc with icl ver 8.0.
I tried using MS linker switch #pragma comment(linker, "/alternatename........"
in the source file but I get the following warning:
a.obj : warning LNK4044: unrecognized option "alternatename:__imp......."
I have MSVC ver 6.0. Do I need MSVC ver 7.0 in order to compile.
Also, the code works fine if I use icl ver7.0 for compilation with the optimization options but crashes with icl ver 8.0.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page