Open joesavage opened 8 years ago
Character constants in C should be of the int type (see C99 §6.4.4.4 paragraph 10), yet using picoc the following snippet produces '1' in cases where it should produce '0' (e.g. when sizeof(int) == 4 and sizeof(char) == 1):
int
sizeof(int) == 4
sizeof(char) == 1
#include <stdio.h> int main(void) { char input = 'A'; printf("%d\n", sizeof(input) == sizeof('A')); return 0; }
Character constants in C should be of the
int
type (see C99 §6.4.4.4 paragraph 10), yet using picoc the following snippet produces '1' in cases where it should produce '0' (e.g. whensizeof(int) == 4
andsizeof(char) == 1
):