Re: ARM/Linux: Is this a cross-compiler bug? ¡]memcpy doesn't work as expected)



Wilco Dijkstra wrote:
"CBFalconer" <cbfalconer@xxxxxxxxx> wrote:

.... snip ...

One of the strengths of C is the fact that code that meets the
requirements of the standard is almost always totally portable. By
itself this is not the final word, but it makes it easy to isolate
and emphasize what code needs modification during a port.

No non-trivial piece of code meets all requirements of the standard.
Have you ever used lint or compiled some application with the strict
conformance checking option? You will be surprised. Even if it does
compile, it will still contain implementation defined behaviour which
makes it theorhetically unportable. In practise most non-conforming
code is portable, so there is no advantage at all in being conformant.

I routinely compile everything with virtually all error catching
enabled. If something appears that is not portable, I either
rewrite it to be portable (prefereable, unless there is a
significant performance penalty) or remove it to an isolated
<system-dependant> module. You will be surprised how portable your
code becomes, and how easy such writing becomes.

I eschew long functions, and I use the following alias (single
line) to execute gcc as cc:

gcc -W -Wall -ansi -pedantic -Wwrite-strings -Wfloat-equal -gstabs+
-ftrapv

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


.



Relevant Pages

  • Re: Anyone object to the following change in libc?
    ... I don't know if we can say the ISO C standard has precedence here; ... This is actually recognized in conformance testing, ... > TL>requires you to compile with a c89 compiler, ...
    (freebsd-current)
  • Re: ARM/Linux: Is this a cross-compiler bug? ¡]memcpy doesnt work as expected)
    ... itself this is not the final word, but it makes it easy to isolate ... No non-trivial piece of code meets all requirements of the standard. ... I routinely compile everything with virtually all error catching ...
    (comp.arch.embedded)
  • Re: <ctype.h> toLower()
    ... > If it's a free standing implimentation, then the scope of the standard is ... I am talking about the compiled object code when I mean ... advantages of object code far outweigh source code in terms of portability. ... > you compile it with a hosted implimentation for that platform). ...
    (alt.comp.lang.learn.c-cpp)
  • Re: export
    ... > The standard mandated lots of things not demanded by the market, ... Only when you think of templates as functions. ... You don't compile them to object code, ... cannot make libraries of metafunctions and meta-object files with any ...
    (comp.lang.cpp)
  • Re: XML and OO COBOL
    ... >> allowed the implementors to describe an implementation that had only the ... >> or they would not be in conformance, ... Quite right - Chuck is spelling it out like it is, constrained by rules, ...
    (comp.lang.cobol)