Re: Compiling source code out of the blue
- From: Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx>
- Date: Wed, 02 Jan 2008 14:29:00 GMT
On Wed, 2 Jan 2008 08:11:15 -0600, Tomás Ó hÉilidhe wrote
(in article <Xns9A1990538E4A1toelavabitcom@xxxxxxxxxxxxxx>):
Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx> wrote in comp.lang.c:
That can happen with code coming from <any platform>. It isn't fun,
because a blanket statement like "it just works fine", when taken from
code that hasn't been ported already, implies a lot about the person
giving it to you, and almost nothing about the code itself.
I tend to be dealing with command-line programs which should be fully-
portable. For example, a program to calcuate a network card's serial
number from its MAC address.
You don't need errors or warnings? How can you possibly support that,
/especially/ the former?
Because the program is know to work perfectly.
On some other platform. "known to work" programs frequently suffer
from bugs that don't appear on Platform A when you move it to PLatform
B. Platform-specific interfaces, UB, byte-order issues, lots of
things.
Working with Linux, people distribute source code a lot. So much so, that
gcc comes built-in to the operating system. You think you're downloading
a binary for a program, and then when you open readme.txt, it tells you
to do:
make
make install
Usually come configuration is required for anything but trivial
programs, such as the ./configure stuff.
Makefiles are nice for this for anything but trivially small projects.
If you are getting projects that were built with something like Visual
from MS, the project files are likely to not help you much on other
platforms, so you may have to build some of these yourself, unless you
really like invoking things manually file by file.
What's a makefile? Is it a list of parameters to pass to the compiler? Is
there any standard kind of makefile, or do all compilers have a different
format?
Are you serious?
* Applies any and all optimisations it wants.
You want the compiler to decide the optimization settings? I'd think
a good starting point might be -O2.
Interestingly enough, I compiled by program with -O3 and now the binary
doesn't work properly... I'll look into why.
I guess the code isn't perfect after all.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw
.
- Follow-Ups:
- Re: Compiling source code out of the blue
- From: Tomás Ó hÉilidhe
- Re: Compiling source code out of the blue
- References:
- Compiling source code out of the blue
- From: Tomás Ó hÉilidhe
- Re: Compiling source code out of the blue
- From: Randy Howard
- Re: Compiling source code out of the blue
- From: Tomás Ó hÉilidhe
- Compiling source code out of the blue
- Prev by Date: Re: Problem with fork inside a thread and execv()
- Next by Date: Re: Compiling source code out of the blue
- Previous by thread: Re: Compiling source code out of the blue
- Next by thread: Re: Compiling source code out of the blue
- Index(es):
Relevant Pages
|