Re: [PATCH 7/16] Let void have sizeof 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> But how about void *? If void *p = x, what p+1 should be? Gcc defines
> sizeof(void) being 1, and people seem to know and use this.
> http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html#index-Wno_002dpointer_002darith-347

Using pointer arithmetic on void* is not as crazy as using
sizeof(void) directly. Most people using void* arithmetic is
thinking it as char *. You should able to add a one line change
in evaluate_ptr_add() to allow void* pointer arithmetic.

Still better than hard code sizeof(void) as 1.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux