3 ms·
> void pointers are incremented or decremented by 1 byte. No, void pointer arithmetic is not allowed by the C standard: https://stackoverflow.com/questions/352
by jwilk 6y ago
> void pointers are incremented or decremented by 1 byte.
No, void pointer arithmetic is not allowed by the C standard: https://stackoverflow.com/questions/3523145/pointer-arithmetic-for-void-pointer-in-c#3524270 https://stackoverflow.com/questions/3523145/pointer-arithmet...
- MaxBarraclough 6y agoAn unfortunate typo there: void pointer arithmetic is not allowed.
- jwilk 6y agoOops! Fixed, thanks.
- colejohnson66 6y agoThat answer does mention that GCC permits it as an extension. If the author uses GCC, maybe that’s where the confusion comes from?
- jwilk 6y agoBut then he also writes that "sizeof(void) is illegal". OTOH, GCC documentation says "sizeof is also allowed on void and on function types, and returns 1".