From: Wolfgang Denk <wd@denx.de>
To: Carlo Parravicini <c.parravicini@sehitaly.com>
Cc: "linuxppc-embedded@lists.linuxppc.org"
<linuxppc-embedded@lists.linuxppc.org>
Subject: Re: ELDK 3.0 C++ Problem
Date: Wed, 19 May 2004 19:56:31 +0200 [thread overview]
Message-ID: <20040519175636.8BA66C109F@atlas.denx.de> (raw)
In-Reply-To: Your message of "Wed, 19 May 2004 17:57:48 +0200." <200405191757.48552.c.parravicini@sehitaly.com>
In message <200405191757.48552.c.parravicini@sehitaly.com> you wrote:
>
> have anybody problems using ELDK3.0 ppc_8xx-g++ cross-compiler(x86) on 'new'
> function?
What makes you think this is a problem with ELDK's C++ compiler? Did
you for example try to compile the same program with a native GCC 3.x
C++ compiler on your PC?
> I try to run a stupid program like that on a linux 2.4.4 (previus ELDK 2.1) &
> linux 2.4.24 (ELDK 3.0)
I agree with your rating ;-)
> //=================================================
> #include <iostream>
> #include <string.h>
> int main (int argc, char **argv)
> {
> int *p = new int (10000);
> memset ( p, 0, 10000);
> if (p == NULL)
> std::cout << "Allocation error\n";
> else
> std::cout << "OK.\n";
>
> return 0;
> //=================================================
This program cannot be compiled, there is a '}' missing.
> ppc_8xx-g++ =Wall cpp.cpp -o cpp
This was most definitely NOT the command line you used.
> Both give me a segmentation fault on 'new' execution
What makes you think so? I bet a case of beer that the 'new" returned
just fine, and that your program segfaulted in memset() instead.
Of course you didn't see this, as your test if p is NULL is much too
late, and obviously you didn't bother to run the program under a
debugger.
> Any other have c++ compiling problems or have compiled c++ code successfuly?
There are no known C++ problems specific to the ELDK (i. e. except
those that apply to the native version of the same GCC as well).
The problem is not with the ELDK.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
Nail here --X-- for new monitor.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2004-05-19 17:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-19 15:57 ELDK 3.0 C++ Problem Carlo Parravicini
2004-05-19 17:56 ` Wolfgang Denk [this message]
2004-05-20 14:02 ` Carlo Parravicini
2004-05-20 16:14 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2004-05-19 21:38 Gosha, Michael (Michael)
2004-05-19 23:17 ` Wolfgang Denk
2004-05-21 16:46 Wells, Charles
2004-05-21 18:26 ` Mark Chambers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040519175636.8BA66C109F@atlas.denx.de \
--to=wd@denx.de \
--cc=c.parravicini@sehitaly.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).