Article View: comp.dsp
Article #2656Re: g21k under OS/2
From: Lawrence Kirby
Date: Thu, 19 Nov 1998 00:00
Date: Thu, 19 Nov 1998 00:00
53 lines
3223 bytes
3223 bytes
In article <3653A950.30D9@well.com> shiva@well.com "Ken" writes:
>[g21k is DOS-based Gnu C 2.3.3 targeted for Analog Devices SHARC 21000
>architecture.]
>
>I'm compiling in a DOS window under OS/2, specifically Warp 4 with
>fixpak 8. After a few modules compile, the whole system crashes to a
>register screen. It's not related to a specific source module, as
>following a reboot, the Make will resume, go for a few more modules, and
>crash again. Anyone seen this? It's most likely IBM's fault, but I don't
>have a good idea on how to narrow it down for a bug report or
>workaround. I suppose I'll have to start doing my compiles under NT and
>hope it works a little better.
It would probably have been worth splitting your article up since it
consists of unrelated parts. For example this question is inappropriate
for comp.lang.c.
>Also, I've inherited an idiom that looks like this:
>
>[in header]
>#define LOCAL_LINKAGE
>#define near
>#define local_proc static near LOCAL_LINKAGE
>
>[in .c file]
>int local_proc foo (int arg) { ... }
>
>g21k warns about "static" not being at the beginning of the declaration.
>Does standard C not allow "static" (a property of the function, not the
>return type) to be sytacticly adjacent to the function name?
Declaration specifiers are allowed to appear in any order. However it is
good practice to put storage class specifiers (static, register, typedef
etc.) first. Indeed the current C standard deprecates any other use. This
is why the compiler warns you about this (but doesn't refuse to compile).
A C compiler is allowed to warn about anything it likes as long as it
still compiles valid programs.
>I've also seen warnings about an array index being of type char. Why
>should it care?
chars are allowed to be used as array indexes but gcc has apparently
chosen to warn you about such use because plain char can be signed or
unsigned on different implementations. This could trip up the unwary.
You'd be better off using something like unsigned char for this sort
of thing and I believe gcc won't complain about that.
--
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID:
<911478372snz@genesis.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<365244F8.5371@well.com> <72u0o6$nad@gcsin3.geccs.gecm.com> <3653A950.30D9@well.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,64e721e99efdb086 X-Google-Attributes: gid11318c,public X-Google-Thread: 10c4f5,64e721e99efdb086 X-Google-Attributes: gid10c4f5,public X-Google-Thread: 1014db,64e721e99efdb086 X-Google-Attributes: gid1014db,public X-Google-Thread: f8fcc,88111ff3decc9144 X-Google-Attributes: gidf8fcc,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: g21k under OS/2 Date: 1998/11/19 Message-ID: <911478372snz@genesis.demon.co.uk> X-Deja-AN: 413486722 References: <365244F8.5371@well.com> <72u0o6$nad@gcsin3.geccs.gecm.com> <3653A950.30D9@well.com> X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!genesis.demon.co.uk X-Trace: mail2news.demon.co.uk 911479406 mail2news:20971 mail2news mail2news.demon.co.uk Organization: none Reply-To: fred@genesis.demon.co.uk Newsgroups: comp.dsp,comp.os.os2.bugs,comp.lang.c,gnu.gcc.help