473,511 Members | 16,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bit Problem I met with IAR's C++ Compiler


i am using IAR's C++ compiler for M16C target. i found many things with this
product are very strange. i hope someone here can use his experience with the
language and compiler to help me find a clue.

1, Parameter can not be passed into class method.

class Foo {
public:
void paraTest(const int i)
{
if ( i == 500 )
beep();
}
};

so i call the paraTest with foo.paraTest(500) and expect a beep. but, nothing
happened! (my beep function has no problem because it can beep in other place)

2, static initializable data will simply disappear

in one cpp file's outest scope, i have,

static int intArray[5] = {1, 2, 3, 4, 5};

but, once i defined this kind of data, the program would halt. i then checked
the generated map file and found initialization data segment has a size of
zero!

however, if i reference the intArray in some place of the program ( in the main
function), the program will run normally and won't halt. i have already turned
off any option about optimization.

3, the program can only compiled in Far data mode if i use STL

a simple declare of std::string will cause the program crash if i compile the
program in NEAR data mode. but it seems ok if i compiled it in FAR data model.
In my whole experience of programming, i never ever met phenomena like
above. any help will be highly appreciated!

--
steven woody (id: narke)

Virginia Woolf: Someone has to die Leonard, in order that the rest of
us should value our life more.

- The Hours (2002)
Nov 22 '05 #1
2 1528
Steven Woody wrote:
i am using IAR's C++ compiler for M16C target. i found many things with this
product are very strange. i hope someone here can use his experience with the
language and compiler to help me find a clue.

1, Parameter can not be passed into class method.

class Foo {
public:
void paraTest(const int i)
{
if ( i == 500 )
beep();
}
};

so i call the paraTest with foo.paraTest(500) and expect a beep. but, nothing
happened! (my beep function has no problem because it can beep in other place)

2, static initializable data will simply disappear

in one cpp file's outest scope, i have,

static int intArray[5] = {1, 2, 3, 4, 5};

but, once i defined this kind of data, the program would halt. i then checked
the generated map file and found initialization data segment has a size of
zero!

however, if i reference the intArray in some place of the program ( in the main
function), the program will run normally and won't halt. i have already turned
off any option about optimization.

3, the program can only compiled in Far data mode if i use STL

a simple declare of std::string will cause the program crash if i compile the
program in NEAR data mode. but it seems ok if i compiled it in FAR data model.
In my whole experience of programming, i never ever met phenomena like
above. any help will be highly appreciated!

--
steven woody (id: narke)

Virginia Woolf: Someone has to die Leonard, in order that the rest of
us should value our life more.

- The Hours (2002)


I don't have any experience with this compiler, but it sounds like it
is non-conformant, buggy, or both. Hence, your post is unfortunately
off-topic here since this newsgroup is for standard C++ language
discussions rather than compiler-specific questions, and you'll have to
either talk to your vendor or post in a more relevant newsgroup.

See the FAQ for what is on-topic and for some suggestions on which
other groups you can try:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9 .

Cheers! --M

Nov 22 '05 #2
Steven Woody wrote:
i am using IAR's C++ compiler for M16C target. i found many things with this
product are very strange. i hope someone here can use his experience with the
language and compiler to help me find a clue.

[...]


First off, have you tried contacting their technical support? If yes,
what (if anything) did they say? If not, why not?

V
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2313
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild...
13
2538
by: Bryan Parkoff | last post by:
You may notice that switch (...) is much faster than function that can gain a big improved performance because it only use JMP instruction however function is required to use CALL, PUSH, and POP...
10
2535
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
13
10645
by: john.constantine | last post by:
Hi I have this code: template<typename ClassType> struct S { template<typename FunctionType> void member() {}; };
7
3092
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
16
5349
by: robin.pain | last post by:
Inlining assembler in a *.c file:- Both __asm("nop \n") and __asm("nop")
0
2387
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
3
5243
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
41
18064
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
7355
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.