News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Recent posts

#71
General discussion / Re: Testing code with other C ...
Last post by TimoVJL - October 20, 2026, 09:18:46 PM
I like to test codes for compability reasons.

TLPeViewUC.c had some cases, like
int i;
...
i  = 0;
and it wasn't used later and was a testing leftover.

char *pName = 0;
...
pName = (char*)pImportBName->Name;


EDIT 2026-10-22: A TLWHView needed a lot of changes to sources and headers for making it compilable with Clang with only using Pelles C Windows headers and libraries and msvcrt.dll
#72
General discussion / Re: Testing code with other C ...
Last post by Vortex - October 20, 2026, 08:18:54 PM
Hi Timo,

Pelles C can detect unused variables too. I guess you found a specific case. Could you share your code if it's possible?
#73
General discussion / Testing code with other C comp...
Last post by TimoVJL - October 20, 2026, 05:04:34 PM
If program code avoid crt, it might be easy to compile it with different compilers.
I use clang-cl.exe as a reference C compiler to see more warnings, but some projects was quite easy to build with clang and with polink with Pelles C libraries.
With clang i saw many unused variables and dead code.
#74
Add-ins / Re: Hint Add-IN
Last post by Michele - October 16, 2026, 11:33:38 PM
Quote from: TimoVJL on October 16, 2026, 11:02:19 PM
Quote from: Michele on October 16, 2026, 10:52:21 PMFor sake of precision, my name is Michele, an italian male name.
Sorry about that, i wrote just too fast and having bad fingers  :(
Not a problem at all  :)
I Added a table creator/editor to DynSQLite.
#75
Add-ins / Re: Hint Add-IN
Last post by TimoVJL - October 16, 2026, 11:02:19 PM
Quote from: Michele on October 16, 2026, 10:52:21 PMFor sake of precision, my name is Michele, an italian male name.
Sorry about that, i wrote just too fast and having bad fingers  :(
#76
Add-ins / Re: Hint Add-IN
Last post by Michele - October 16, 2026, 10:52:21 PM
Quote from: TimoVJL on October 16, 2026, 03:49:00 PMA tool for checking database before Michelle publish his
https://forum.pellesc.de/index.php?msg=21897
Hello TimoVJL, I'm almost ready to release the app. I will do in next days just cleaning up.
For sake of precision, my name is Michele, an italian male name.
#77
Add-ins / Re: Hint Add-IN
Last post by TimoVJL - October 16, 2026, 03:49:00 PM
A function database is a nice idea.
For example GDIPlusFlat function defines could add to source code or private header directly.

A tool for checking database before Michele publish his
https://forum.pellesc.de/index.php?msg=21897
#78
Add-ins / Re: Hint Add-IN
Last post by John Z - October 16, 2026, 12:32:10 PM
Well no downloads of the last version :( , anyway -

Here is a new version of the Hint Add-in. This Hint version 2, is updated to include the features in the recent Hint_SA version.  Using Pelles Menu Tools - Options - Add-ins - 'PellesC win32 API Function Hint' then select the Options button, one can choose their preferred web search provider and if they want the output to just go to the Pellec Output tab rather than the output Dialog window.

It also includes a few minor tweaks here and there.

The database has not changed but is included here just in case needed.  Hint Add-in and Hint_SA both use the same database and the same Win32.chm.

Sources are included as well as a ready to use Hint.dll.

John Z

Are there other search providers that would be helpful to add? Send me a message through Pelles.
#79
Bug reports / Re: Merging 4 byte loads into ...
Last post by TimoVJL - October 14, 2026, 02:08:40 PM
Bug have been since version 11  :(
#80
Bug reports / Merging 4 byte loads into 32 b...
Last post by omolin - October 14, 2026, 12:59:48 PM
Hi I ran into this problem when optimization was enabled. Without it the code runs fine.
As I'm not x86 assembly fluent that report part is AI generated, but I hope it should be clear what the issue is:

Pelles C 14.50.0 (pocc 14.50.0, polink 14.50.1), Windows 11 x64. Also seen on 13.00.9.
Target /Tx64-coff. Fails at /Ot, /Ox, /Os, /O1 and /O2; correct without /O.

Repro (repro.c):

#include <stdio.h>
#include <stdint.h>
#include <string.h>

static uint32_t get_le32(const uint8_t *f, size_t n)
{
    return (uint32_t)f[n - 4] | ((uint32_t)f[n - 3] << 8) |
           ((uint32_t)f[n - 2] << 16) | ((uint32_t)f[n - 1] << 24);
}

int main(void)
{
    uint8_t buf[64];
    size_t n;
    int bad = 0;
    for (n = 0; n < sizeof buf; n++)
        buf[n] = (uint8_t)(n * 7u + 1u);
    for (n = 4; n <= sizeof buf; n++) {
        uint32_t got = get_le32(buf, n), want;
        memcpy(&want, buf + n - 4, 4);
        if (got != want) { printf("n=%u: got %08X want %08X\n", (unsigned)n, got, want); bad++; }
    }
    printf("%s\n", bad ? "FAIL" : "OK");
    return bad != 0;
}

Build:
  pocc /Tx64-coff /std:C11 /Ze /MT /Ot repro.c
  polink /SUBSYSTEM:CONSOLE /MACHINE:X64 repro.obj

Result:
  without /O : prints OK
  /Ot /Ox /Os /O1 /O2 : "CRT: unhandled exception (main) -- terminating"

Generated code for get_le32 at /Ot (pocc /Tx64-asm):
  add rcx,rdx
  mov rax,4294967292        ; 0x00000000FFFFFFFC
  mov eax,dword [rcx+rax]   ; reads f + n + 4 GB - 4 -> access violation
  ret

Merging the four byte loads into one dword load is fine. The bug is the displacement:
-4 is materialized as the 32-bit value 0xFFFFFFFC zero-extended to 64 bits, instead of
sign-extended (mov rax,-4, or simply dword [rcx+rdx-4]). It looks like the
"n - 4" offset is computed in 32-bit unsigned arithmetic and then widened when the
index is size_t.