ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Вторник
30 апреля
382393 Топик полностью
Codavr (23.01.2013 02:33 - 03:25, просмотров: 180) ответил fk0 на Ссылку на раздел C99, где говорится, что арифметика над void* нормальна? Вот тут утверждают обратное.
§6.2.6.1 пункт 27 http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1336.pdf
A pointer to void shall have the same representation and alignment requirements as a pointer to a character type.41) Similarly, pointers to qualified or unqualified versions of compatible types shall have the same representation and alignment requirements. All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Pointers to other types need not have the same representation or alignment requirements. 6.3.2.3 пункт 1 A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to a pointer to void and back again; the result shall compare equal to the original pointer. 7.18.1.4 пункт 1 Integer types capable of holding object pointers 1 The following type designates a signed integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer: intptr_t The following type designates an unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer: uintptr_t These types are optional. Что до гнуся, то здесь "GCC, невзирая на его расширенную поддержку C99, все ещё является не полностью совместимой реализацией: некоторые особенности не реализованы или работают некорректно."
Долой империалистический интернационал!