S
Spiros Bousbouras
#include <stdlib.h>
int main(void) {
char **p1 ;
const char **p2 ;
p1 = malloc(5 * sizeof(char *)) ;
if (p1 == 0) return EXIT_FAILURE ;
p2 = p1 + 1 ;
p2 - p1 ;
return 0 ;
}
When I try to compile the above on gcc 4.1.2 I get
t.c: 10: error: invalid operands to binary -
Is it a compiler bug ? It seems legal to me.
int main(void) {
char **p1 ;
const char **p2 ;
p1 = malloc(5 * sizeof(char *)) ;
if (p1 == 0) return EXIT_FAILURE ;
p2 = p1 + 1 ;
p2 - p1 ;
return 0 ;
}
When I try to compile the above on gcc 4.1.2 I get
t.c: 10: error: invalid operands to binary -
Is it a compiler bug ? It seems legal to me.