This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Implicit conversion from structure to its pointer?
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: 황명규 <mghwang at innoace dot com>, gcc-help at gcc dot gnu dot org
- Date: Wed, 01 Oct 2003 06:29:15 -0500
- Subject: Re: Implicit conversion from structure to its pointer?
Hi Myung-gyu,
To pass a struct to bzero, you should've needed to do this:
bzero(&b, sizeof b);
Maybe GCC 3.0.1 has a bug. Try GCC 3.3.1, which is the current release.
Arrays are supposed to be liberally converted to pointers. I don't think structs are supposed to be liberally converted to pointers.
Did you forget your terminating semicolon for your struct a?
HTH,
--Eljay
Note: bzero is not a standard library function. It's a holdover from BCPL days. Use memset if you want portability.