News:

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

Main Menu

Recent posts

#11
Announcements / Re: Release Candidate #1 for v...
Last post by TimoVJL - March 15, 2026, 09:57:54 PM
Thanks for new version for testing.

Windows 7 SP1 with an old AMD CPU without MOVBE:

poide crash
ModLoad: 00000001`3f7c0000 00000001`3fb5c000   poide.exe
...
ModLoad: 000007fe`e2bc0000 000007fe`e2bec000   C:\code\PellesC14rc1\Bin\Wizards64\wininst.dll
(8964.84dc): Illegal instruction - code c000001d (first chance)
(8964.84dc): Unknown exception - code c000041d (!!! second chance !!!)
*** WARNING: Unable to verify checksum for poide.exe
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for poide.exe -
poide!WizScanForDependenciesA+0xe2846:
00000001`3f293d46 660f38f1442430  movbe   word ptr [rsp+30h],ax ss:00000000`009eebd0=0000

polink crash
ModLoad: 00000001`3f8f0000 00000001`3f935000   image00000001`3f8f0000

...
(8958.8a30): Illegal instruction - code c000001d (first chance)
(8958.8a30): Illegal instruction - code c000001d (!!! second chance !!!)
*** WARNING: Unable to verify checksum for image00000001`3f8f0000
*** ERROR: Module load completed but symbols could not be loaded for image00000001`3f8f0000
image00000001_3f8f0000+0x1984:
00000001`3f8f1984 0f38f14608      movbe   dword ptr [rsi+8],eax ds:00000000`00222220=baadf00d
polib fail
Building zlib.lib.
POLIB: fatal error: An internal error occurred.

https://uops.info/html-instr/MOVBE_R32_M32.html

Incompatible CPU
AMD Athlon(tm) II X2 220 Processor
Intel Core i5-2450M CPU


https://en.wikipedia.org/wiki/Jaguar_(microarchitecture)

Not sure, if this detect MOVBE
#include <intrin.h>

void __cdecl exit(int status);
int printf(const char * restrict format, ...);

#pragma comment(lib, "msvcrt.lib")
//#pragma comment(linker,"/subsystem:console,5.1")
void __cdecl mainCRTStartup(void)
{
    int __cdecl main(void);
    void __cdecl exit(int status);
    exit(main());
}

// CPUID.(EAX=01H, ECX=0H):ECX.MOVBE[bit 22]
// EAX, EBX, ECX and EDX
//  0,   1,   2,      3
int GetCPUFeature(void)
{
    int r[4];    // EAX, EBX, ECX and EDX
    int rc = 0;
    _cpuid(r, 0);    // Highest Function Parameter and Manufacturer ID
    if (r[0] != 0x500) {    //
        _cpuid(r, 1);    // Processor Info and Feature Bits
        rc = _bittest((const long int *)&r[2], 22);

    }

    return rc;
}

int main(void)
{
    printf("CPU options: %d\n", GetCPUFeature());
    exit(0);
}
#12
Announcements / Release Candidate #1 for versi...
Last post by Pelle - March 15, 2026, 06:39:56 PM
See https://www.pellesc.se/, Download and Changes.
#13
Bug reports / Re: bug report. setvbuf() func...
Last post by Pelle - March 15, 2026, 11:45:36 AM
In the low-I/O C runtime function _write(), when operating in text mode (ANSI/UTF-16LE/UTF-8/...), there is a ~2kB buffer for LF to CRLF translation. When this buffer is full, the content is sent to the destination (console/file/...), the buffer cleared, and the translation resumed. When resuming the translation the first character was lost (in translation).

( The printf family is one path to the _write() function )
#14
Bug reports / Re: stdckdint.h bug report
Last post by Pelle - March 15, 2026, 11:32:37 AM
I think ckd_<op>() came more or less straight from GCC to the C23 standard, and like some other GCC "innovations" it's a bit over-worked / under-thinked.

I will revise my initial implementation slightly, mostly just to reject more bogus cases -- like the original bug report.
#15
Beginner questions / same code pelles c and gcc got...
Last post by ander_cc - March 15, 2026, 11:30:22 AM
#include <stdio.h>
#include <stdbit.h>
int main() {
    unsigned short a1 = 4;
unsigned int a2 = 4;

printf("a1 one:%u  a1 zero:%u\n", stdc_first_leading_one(a1), stdc_first_leading_zero(a1));
printf("a2 one:%u  a2 zero:%u\n", stdc_first_leading_one(a2), stdc_first_leading_zero(a2));
   
    return 0;
}
gcc 11.4 -std=c23
a1 one:14  a1 zero:1
a2 one:30  a2 zero:1
-----
pelles c 13.01
a1 one:3  a1 zero:16
a2 one:3  a2 zero:32
-----
WHY? and which is right?
#16
Bug reports / Re: O_BINARY
Last post by Pelle - March 15, 2026, 11:24:11 AM
This is more about policy, I think. I document only the header file where the function prototype is located, because that was easy to start with.

Some functions will "need" more header files, some functions will need a #define <symbol> before the #include <...> to activate the prototype, but with over 1000 pages in the "C runtime" folder (not all of them related to functions, but anyway) it's a bit hard to find the energy just to begin investigating what to update (and how)...
#17
Projects developed with Pelles C / Mighty Eagle
Last post by rweidner - March 15, 2026, 01:33:10 AM
https://github.com/xecronix/MightyEagleC


# Mighty Eagle C

Mighty Eagle C is a C implementation of the Mighty Eagle template engine.

The Mighty Eagle Templating Solution (METS) is capable of replacing a properly
tagged text document with external data. This solution has the added advantage
of being easily extended via the use of callbacks. Using callbacks a programmer
can easily model recursive data and on the fly data translations. Some use cases
include translation of data from one format to another, generic templated documents,
mail templates, and other similar tasks, batch file creation (.bat). The program is
particularly well suited for translation of relational data to hierarchical
visualizations.

This repo currently contains:

- a static library build target
- a demo executable that generates nested HTML output
- a test runner executable that validates behavior using scenario files and golden output

## Current Build Outputs

- `MightyEagleLib32.lib`
- `MightyEagleDemo32.exe`
- `MightyEagleTest32.exe`

## PellesC Workspace - Easiest build method uses the IDE
MightyEagleLib32.ppw

## Build

```console
pomake.exe MightyEagleLib32.ppj
pomake.exe MightyEagleTest32.ppj
pomake.exe MightyEagleDemo32.ppj
```

## Run Tests

```console
MightyEagleTest32.exe
```

## Run Demo

```console
MightyEagleDemo32.exe
```

## Notes

- This project was rebuilt from the original Euphoria implementation and the project specs with ChatGPT assistance.
- The main behavioral rules live in `docs/10_library_spec.md`.
- The current environment validated the 32-bit static library target.

#18
User contributions / Re: Has anyone built a crude ...
Last post by rweidner - March 13, 2026, 08:27:43 PM
Well, I looked closer at adding Crude to the tools section of PellesC IDE. While the IDE itself makes that task simple to do, Crude was designed as a per-project tool. Therefore, I stopped trying to integrate it into the PellesC IDE. For me, the juice wasn't worth the squeeze. A small setup process is required for Crude to work. The source directory and destination directory need to be configured. I put the setup in .batch files. I added two . bat files to the project as examples and pushed those to Github.

Example batch files:
1. crude.bat: Create a snapshot revision on demand.
2. compare.bat: Open WinMerge with the latest snapshot compared against the current project state.

#19
User contributions / Re: Has anyone built a crude ...
Last post by TimoVJL - March 13, 2026, 05:48:08 PM
File -> New -> Differences

Help
Integrated Environment ->Differences

EDIT 2026-03-14 From Add-In help:
QuotePurpose:
Starts a File difference job in the IDE.

Syntax (macro):
BOOL AddIn_FileDifference(HWND hwnd, PADDIN_FILE_DIFFERENCE pFileDiff);

Syntax (SendMessage):
SendMessage(hwnd, AIM_FILE_DIFFERENCE, (WPARAM)0, (LPARAM)(PADDIN_FILE_DIFFERENCE)(pFileDiff))
typedef struct tagADDIN_FILE_DIFFERENCE {
    UINT cbSize;
    const WCHAR *pszSpecLeft;
    const WCHAR *pszSpecRight;
    BOOL fRecurse;
} ADDIN_FILE_DIFFERENCE, *PADDIN_FILE_DIFFERENCE;
#20
User contributions / Re: Has anyone built a crude ...
Last post by ddainelis1 - March 13, 2026, 05:31:19 PM
Hello TimoVJL,
Would you have a link on how to use the "internal visual diff using fdiff.dll" ?   

Best regards,

DJD