Download Pelles C here: http://www.pellesc.se
Quote from: John Z on September 01, 2026, 09:24:22 PMDon't delete a good example for others to see to not give up.
The defect, stated exactly,
At -Os, -Ot and -Ox, Pelles C 14.50 for Windows x64 can replace the
constant divisor K of an integer remainder by K modulo 256.
I attach a zipped folder (edited) showing how to build a bug/defect free zlib (no source patch is required) and folder of code which shows evidence for this bug and my bug tracing code!
Hope it helps others - and hope soon this excellent IDE and compiler become open source - it would make the process of bug tracking and fixing super-fast - I am from a Linux background.
QuoteMore than happy to share my code John Z , I need to know how to do that - anyone guide me or direct me to instructions please?
pocc -Tx64-coff -std:C17 -Ze -Zx -Ot -W1 timo.c
checksum 4060 (correct 19900)
mov r8b,2C ; 0x2C is 44
mov al,dl
xor ah,ah
div r8b ; 8-bit unsigned divide
mov al,ah ; take the remainder
mov byte ptr [rcx],al
mov cl,2C ; 0x2C is 44 here too
mov al,bl
xor ah,ah
div cl
mov al,ah
mov byte ptr [esi],al
sum += (*data)++;
for (i = 0; i < 200; i++) data[i] = 0xFF; /* deliberately wrong */
data[0] = 0;
for (i = 0; i < 200; i++) sum += (*data)++;
checksum 19900
int t = i % 300;
data[i] = (unsigned char)t;
int __cdecl printf(const char * restrict format, ...);
int __cdecl main(void)
{
int i;
unsigned long sum = 0;
unsigned char *pdata; // pointer to data
unsigned char data[200]; // safer stack place at end ?
pdata = data;
for (i = 0; i < 200; i++)
*pdata++ = (unsigned char)(i % 300);
pdata = data;
for (i = 0; i < 200; i++)
sum += *pdata++;
//sum += (*data)++;
printf("checksum %lu (correct 19900)\n", sum);
return 0;
}
also with sum += (*data)++;outputchecksum 19900 (correct 19900)int __cdecl printf(const char * restrict format, ...);
int __cdecl main(void)
{
unsigned char *pdata; // pointer to data
int i;
unsigned char data[200];
pdata = data;
for (i = 0; i < 200; i++)
{
*pdata = (unsigned char)(i % 300);
if (*pdata != i)
{
printf("\nerror: %u != %u\n", i, *pdata);
break;
}
printf("%u ", *pdata);
pdata++;
}
return 0;
}
data[i] = (unsigned char)(i % 300);
Quote from: KEL26 on August 30, 2026, 11:09:48 PMFirst, thank you for Pelles C — it has just carried a full port of CFITSIO
4.7.0 (NASA's FITS library, 59 sources), zlib, libpng and FFTW 3.3.11 to a
clean finish, so the report below comes from a codebase your compiler
otherwise handles admirably.
Page created in 0.042 seconds with 15 queries.