SGI: Development

Porting GNU to Irix...

While in my PERSONAL OPINION [mind the capitals, will you], it's easier to
port from MipsPro C/CC to gcc/g++ than the other way 'round, I nevertheless
run into situations where I try to port from GNU which keep me stuck for quite
a while. Here is a concrete example. Apparently, something like

ffi_type *atypes[0];

is swalled by gcc/g++ just fine.

However, with MipsPro 7.4.4, I only get an error:

Code: Select all

The constant array dimension size is not a positive integral type.

ffi_type *atypes[0];
^

Any idea for resolving that?
371- 528 - 818 - ?
Arrays of zero length are a GNU extension: http://gcc.gnu.org/onlinedocs/gcc-4.3.0 ... ength.html

Usually, arrays of variable length (also GNU) are much more annoying to recode.
Now this is a deep dark secret, so everybody keep it quiet :)
It turns out that when reset, the WD33C93 defaults to a SCSI ID of 0, and it was simpler to leave it that way... -- Dave Olson, in comp.sys.sgi

Currently in commercial service: Image :Onyx2: (2x) :O3x02L:
In the museum : almost every MIPS/IRIX system.
Wanted : GM1 board for Professional Series GT graphics (030-0076-003, 030-0076-004)
As the saying goes "It's the fin of a larger fish"

Neither GNU or FOSS actually means portable despite the claims.

There is a whole range between recommending gmake to requiring gcc to build a project.

Another pet peeve is people who use C++ style comments in allegedly C code.
Land of the Long White Cloud and no Software Patents.
jan-jaap wrote: Arrays of zero length are a GNU extension: http://gcc.gnu.org/onlinedocs/gcc-4.3.0 ... ength.html

Usually, arrays of variable length (also GNU) are much more annoying to recode.

Thanks. Actually, I'd thought myself of settting the length to 1 but wasn't sure about it... :?
371- 528 - 818 - ?
Hmm - I wasn't aware of this... when I came across some code doing the same thing, I replaced the '[0]'s with '[]'s and everything built and tested successfully - although by the sounds of it, this may purely be good luck in that the code was compiled with '-c99'.

Of course, there could now be some deep-seated codepath which won't work correctly or will kill the app - but all seems good so far.
(I think I came across this with either pidgin or libpurple).