-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At some point hitherto, Michael O'Donnell hath spake thusly:
>
> I claim to be a software professional. I claim to know
> C, including some of the more esoteric smoke-and-mirrors
> aspects. I am therefore embarrassed to admit that I am
> stumped by GCC's complaints about the following fragment:
>
> mystery * /* Function type - no problem */
> problem(
> mystery *mystery ) /* Parameter declaration - no problem */
> {
> mystery *hosed; /* Auto variable declaration - choke and die! */
>
> hosed = mystery->next = nextMystery;
> nextMystery = mystery;
> return( hosed );
> }
In the line in question, is "mystery" a type, or are you refering to
the pointer mystery? It seems GCC thinks it's the latter. I changed
your code thusly:
mystery * /* Function type - no problem */
problem(
mystery *french ) /* Parameter declaration - no problem */
{
mystery *hosed; /* Auto variable declaration - choke and die! */
hosed = french->next = nextMystery;
nextMystery = french;
return( hosed );
}
This compiles fine. It seems that GCC gets confused between the type
and the parameter. And this makes perfect sense to me... After all,
would you ever do something like:
...
int int;
int = 3;
...
This is essentially what you've done. Even if it were legal (which it
isn't), it strikes me as a really, really bad idea.
- --
Derek Martin [EMAIL PROTECTED]
- ---------------------------------------------
I prefer mail encrypted with PGP/GPG!
GnuPG Key ID: 0x81CFE75D
Retrieve my public key at http://pgp.mit.edu
Learn more about it at http://www.gnupg.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE8hW9jdjdlQoHP510RAjAsAJ4/+v4RbZ23pbDOXK+APme7xjVX+wCgli4t
s+3vb+ZPGK2MbUqe3poE8Zs=
=PAvZ
-----END PGP SIGNATURE-----
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************