1: Sample code that reproduces the problem.
struct S
{
int *b : 1;
};
2: Exact command used to run SDCC on this sample code.
sdcc -mz80 --std=c2y --nostdinc -S bug.c -o bug.asm
3: SDCC version tested.
SDCC 4.6.4 #17068 (Linux), tested 23 October 2026.
4: Observed and expected behaviour.
SDCC exits successfully and emits no diagnostic. A diagnostic is required.
N3886 6.7.3.2 paragraph 5 restricts bit-field types to the standard-listed types and any other implementation-defined types. The retained SDCC manual (doc/sdccman.lyx, section on enumerations and bit-fields) explicitly lists bool, int, signed int, unsigned int and bit-precise integer types, with no additional permitted types. A pointer type is not in that list.
Reference: N3886.
5: Additional checks.
The typedef variant is also accepted silently:
typedef int *P;
struct S
{
P b : 1;
};
An ordinary pointer member without a bit-field width is valid. A one-bit bool field is valid. Both compile without diagnostics. A float bit-field is already rejected with error 30.
All invalid variants were accepted without diagnostics on Z80, MCS51, STM8, PDK14 and MOS65C02 in C99, C11, C23 and C2Y modes. GCC 13.3.0 with -std=c2x -pedantic-errors -fsyntax-only rejects them and accepts the valid cases. GCC 16.2 and Clang were not tested.