Note to self:

When compiling software written to C99 standards, call the compiler so it actually knows it's SUPPOSED to be parsing ANSI code, not K&R.

That is all.

From: [identity profile] paoconnell.livejournal.com


You don't use makefile(s) or the equivalent (project files in some environments), so that compile flags are the same each time?

From: [identity profile] jsbowden.livejournal.com


I'm building GNU things off the net. I'm using :

#cc -version:
MIPSpro Compilers: Version 7.4.3m

since I'd rather kill myself than use GCC for anything other than software that absolutely will not build without it. The current versions of most GNU things are ANSI C[90|99] if they aren't GCC dependent.

SGI's cc defaults to K&R, and the GNU software that will build with it doesn't know to call it with the correct flag to put the compiler in ANSI, and at what level. I have simply set an environment variable that overrides autoconf's preference to do things my way, instead of the way it wants. I could edit a zillion autoconf files and submit patches, but really, I don't have that kind of free time.

From: [identity profile] paoconnell.livejournal.com


I've programmed and compiled on an SGI O2, maybe 7 years ago, so my memory's fuzzy. We weren't trying to compile Gnu code, though.
I'd think that if you were trying to compile a lot of Gnu code you would want to set your compile defaults to something that compiles everything correctly, especially if you're doing custom programming on the workstation and want to use ANSI anyway.

From: [identity profile] jsbowden.livejournal.com


I'm not writing any code. I'm just trying to compile current versions of all the GNU software I have in /usr/local (which is an NFS share to all the SGIs on my network). Some of these utils I orginally compiled 6 years ago on Irix 6.2 on an Indy. The problem is that current SGI MIPSpro compilers behave differently depending how you call them, instead of the old way of setting CFLAGS="set your magic incantation for [ANSI|C90|C99] here". Last time I went through this, I could just set /etc/compiler.defaults to the way I wanted it and only override via environment variable if necessary for a specific piece of software. Last time I went through this, most of the GNU stuff that didn't require GCC was still primarily K&R or plain ANSI, which the compiler is generally smart enough to deal with on it's own. It's the newer ANSI [C90|C99] code that's making life interesting. That it can't seem to automagically handle.
.

Most Popular Tags

Powered by Dreamwidth Studios

Style Credit

Expand Cut Tags

No cut tags