История изменений
Исправление xaizek, (текущая версия) :
Насколько я помню, стандарт предписывает, что адресная арифметика на void * запрещена. Если компилятор это разрешает, то это расширение, которое работает с void * как с unsigned char *.
6.2.5 Types 1. ... Types are partitioned into object types (types that fully describe objects), function types (types that describe functions), and incomplete types (types that describe objects but lack information needed to determine their sizes). 19. The void type comprises an empty set of values; it is an incomplete type that cannot be completed. 6.5.6 Additive operators 2. For addition, either both operands shall have arithmetic type, or one operand shall be a pointer to an object type and the other shall have integer type. (Incrementing is equivalent to adding 1.)
Исправление xaizek, :
Насколько я помню, стандарт предписывает, что адресная арифметика на void * запрещена. Если компилятор это разрешает, то это расширение, которое работает с void * как с unsigned char *.
6.2.5 Types 1. ... Types are partitioned into object types (types that fully describe objects), function types (types that describe functions), and incomplete types (types that describe objects but lack information needed to determine their sizes). 19. The void type comprises an empty set of values; it is an incomplete type that cannot be completed. 6.5.6 Additive operators 2. For addition, either both operands shall have arithmetic type, or one operand shall be a pointer to an object type and the other shall have integer type. (Incrementing is equivalent to adding 1.)
Исходная версия xaizek, :
Насколько я помню, стандарт предписывает, что адресная арифметика на void * запрещена. Если компилятор это разрешает, то это расширение, которое работает с void * как с unsigned char *.