- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.1.256 Build 20111011 (Linux xXx 2.6.35-31-generic #62-Ubuntu SMP Tue Nov 8 14:20:11 UTC 2011 x86_64 GNU/Linux)
#include
#include
using std::max;
using std::cout;
struct tstruct
{
double a;
tstruct() : a(0) {};
};
int main(int argc, char *argv[])
{
cout << "init t1\\n";
tstruct *t1 = new tstruct[8];
cout << "init t2\\n";
tstruct *t2 = new tstruct[max(5,8)];
};
$ ./a.out
init t1
init t2
Segmentation fault
Any workaround or recommendation?
Michal
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can be work-arounded with a local variable for the "max(5,8)" like:
int nbignum=max(5,8);
tstruct *t2 = new tstruct[nbignum];
Thanks for reporting it.
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When can I expect the fix?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please use the work arround for time being.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
struct DATASTRUCT
{
DATASTRUCT() : dA( 0.0L )
{
};
double dA;
};
...
int i;
//1
int iMax1 = max( 2, 4 );
DATASTRUCT **pDs1 = ( DATASTRUCT ** )new DATASTRUCT[ iMax1 ];
for( i = 0; i < iMax1; i++ )
pDs1 = ( DATASTRUCT * )new DATASTRUCT();
//2 - Notes:
// Constructor of the structure isNot called
// CRT-function 'calloc' initializes allocated memory with Zeros
DATASTRUCT *pDs2 = ( DATASTRUCT * )calloc( max( 2, 4 ), sizeof( DATASTRUCT ) );
//3
int iMax3 = max( 2, 4 );
DATASTRUCT **pDs3 = ( DATASTRUCT ** )calloc( iMax3, sizeof( DATASTRUCT * ) );
for( i = 0; i < iMax3; i++ )
pDs3 = ( DATASTRUCT * )calloc( 1, sizeof( DATASTRUCT ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the reason?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
our compiler engineers are still working on this (last activity was yesterday). Unfortunately we cannot name you the update release which will contain the fix right now. However, Jennifer will come back to you know once we have a compiler update that's validated.
If the workaround posted above should not be suitable for you we might work on an alternative for the time being.
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
this issue is fixed in update 10 (12.1.4.319, Build 20120410). you can download the Intel C++ Composer XE for Linux update 10 from the Intel Registration Center. The evaluation pkg of Intel C++ Composer XE for Linux is also the latest.
I did the verification on IA32 Linux.
Thanks for reporting it.
Jennifer
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page