I'm sure this was valid (or at least permissible) code in gcc 3, but
gcc 4 takes a stricter view of things like extern and variable definition
in order to conform to C99 a little better.

It's probably just an artefact of that?

-- 
Matt Sealey <[EMAIL PROTECTED]>
Manager, Genesi, Developer Relations


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Cyril Plisko
> Sent: Thursday, January 05, 2006 8:56 AM
> To: [email protected]
> Subject: [osol-code] Problematic uts/common/sys/exec.h
> 
> Hi,
> 
> I just stepped on some strange piece of code in subj:
> 
> ...
> 73 extern int nexectype;      /* number of elements in execsw */
> 74 extern struct execsw execsw[];
> 75 extern kmutex_t execsw_lock;
> ...
> 159 struct execsw {
> 160   char    *exec_magic;
> 161   int     exec_magoff;
> 162   int     exec_maglen;
> 163   int     (*exec_func)(struct vnode *vp, struct execa *uap,
> 164               struct uarg *args, struct intpdata *idata, 
> int level,
> 165               long *execsz, int setid, caddr_t exec_file,
> 166               struct cred *cred);
> 167   int     (*exec_core)(struct vnode *vp, struct proc *p,
> 168               struct cred *cred, rlim64_t rlimit, int sig,
> 169               core_content_t content);
> 170   krwlock_t       *exec_lock;
> 171 };
> 
> Compiler chokes on line 74 - execsw[] defined with type 
> specified _later_ in the file. I was always sure that one 
> must define the type _before_ declaring variable of that 
> type. So what is the story here ?
> 
> Just to clarify - I am not using one of the "blessed" 
> compilers - its GCC4.0.0 cross compiler x86 host/ppc target.
> 
> Anyone care to comment ?
> 
> Regards,
>       Cyril
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> https://opensolaris.org:444/mailman/listinfo/opensolaris-code
> 

_______________________________________________
opensolaris-code mailing list
[email protected]
https://opensolaris.org:444/mailman/listinfo/opensolaris-code

Reply via email to