News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#91
Chit-Chat / Re: Permission to include Pell...
Last post by Pelle - October 07, 2025, 11:01:08 PM
Sure... go ahead...
#92
Beginner questions / conio.h trouble
Last post by PhilG57 - October 07, 2025, 10:18:00 PM
Trying to rebuild an old program and now get complaints about conio.h:

C:\Program Files\Pelles C\Include\conio.h(50): error #2019: Invalid use of __declspec(vaformat).

Line 50 in conio.h looks like:

extern _CRTIMP _CRTCHK(printf,1,2) int __cdecl _cprintf(const char * restrict, ...);

The code with which I am working looks like this:

   #include <conio.h>      /* for textcolor and backgroundcolor */
   _textcolor(1);   /* dark blue; very hard to see */
   fprintf(stderr, "rlog %s: ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789\n\r", gszCmdId);
   _textcolor(2);   /* green; very hard to see */

I googled __declspec and saw references to C++ and MSVC but couldn't really figure out anything.  What am I doing wrong?  Thanks.
#93
Chit-Chat / Re: Permission to include Pell...
Last post by Vortex - October 07, 2025, 08:17:14 AM
Hi Pelle,

Is it allowed to add the tools bellow released with PellesC V13 to the Masm32\64 SDKs?

poasm.exe
polib.exe
polink.exe
porc.exe
pope.exe
#94
Bug reports / Re: Invalid jump into VLA bloc...
Last post by Pelle - October 05, 2025, 06:33:22 PM
In some ways this starts with:
size_t bufSize = 1234;
char buffer[bufSize]; 
which creates an array with variable size (VLA), despite the constant.

I have to dig deeper to see why the compiler gets confused about this code (in general)...

EDIT: The compiler is actually tripping up itself here: an injected unwind operation gets the error. Apparently not common with SEH + VLA in the same block...
#95
Bug reports / Re: Crash IDE with 'asm' keywo...
Last post by Pelle - October 05, 2025, 06:23:39 PM
OK, I can reproduce this... (but the asm block needs to be inside a function to cause this problem).

EDIT: You also need source editor setting "Auto-indent: Smart (C only)". The infinite loop was actually in POFMT.DLL, used in a sneaky way by the IDE to figure out the indentation column -- AFAICT you hit the only loop in POFMT that didn't check for EOF...
#96
Bug reports / Invalid jump into VLA block
Last post by Marco - September 17, 2025, 04:14:58 PM
Hello,

While maintaining the code for one of my apps, the compiler displayed the following error message:

error #2211: Invalid jump into 'VLA' block.

After running several tests, I managed to identify the cause of the error and reproduce the problem with a simpler project:

#include <excpt.h>
#include <stdio.h>

// function prototype.
void foo(int);

int main(int argc, char *argv[])
{
  return 0;
}
 
void foo(int a)
{
  __try {

      size_t bufSize = 1234;
      char buffer[bufSize];         // <-- (1)
      int b = a ? 1 : 2;            // <-- (2) - Any ternary operator.

  }
  __except (EXCEPTION_EXECUTE_HANDLER) {
      printf("An exception occurred - the code is %x\n", exception_code());
  }
}

The __try-__except statement is based on the example in the help file.
When building, the compiler should give some warnings that can be ignored for the sake of this example.
It seems that the error is caused by the combination of instructions (1) and (2).

Changing instruction (1) to

char buffer[1234];

or instruction (2) to

int b=2;
if (a) b=1;

fixes the issue.

The error occurs whether optimizations are turned on or off, and whether the target processor is 32-bit or 64-bit.
If it's useful, the following options were used with POCC for compilation: -fp:precise -W2 -Gz -Ze -Zx.

Marco
#97
Tips & tricks / Re: Windows API tutorial for F...
Last post by Vortex - September 16, 2025, 08:43:18 PM
Here is a simple example built with Visg and Pelles C V13.
#98
Tips & tricks / Re: Useful website for WIndows...
Last post by larryli - September 15, 2025, 11:06:14 AM
Catch22 Win32 Tutorials
https://www.catch22.net/tuts/
#99
Work in progress / Re: ChatGPT examples
Last post by jurgenve - September 12, 2025, 10:43:00 AM
New here.
I use (as beginner) Pelles C because it has great capabilities.
Though genuine interested in getting to learn the possibilities within the C language, I do not have time to
become expert. I realise that.
Been reading the various post of this topic, is goes from scepticism about GTP to actually discussing the proper prompts, in only three pages and within the span of only 2 years.

AI will never be the holy grail but to give my opinion about quote below: because every human will be able to write a piece of software using only his natural language. So software engineers will become
as obsolete as horses are used today in traffic. The accelerated pace of this technology and investments, even if the return wil be overrated, is incredible by the way.

QuoteYou'll never know when, and if, what is output is really correct, unless yourself are an expert; but if you are such an expert why ask to ChatGPT

My honest view, though one should still (want) be able to write and understand code.
#100
Tips & tricks / Re: Windows API tutorial for F...
Last post by Vortex - September 04, 2025, 10:17:13 PM
An interesting tool available from Vanya's page :

QuoteVISG : A great visual editor for creating a GUI interface. The conversion is into pure API code. In addition to converting code into Freebasic, it also supports other languages: MASM, GCC, FreePascal, etc. It can clone an interface from a ready-made one, there is a built-in simple scripting language, so you can always tweak something additional. The source code is open. Author: Alexander G. Karpov.

https://users.freebasic-portal.de/freebasicru/download.html

https://users.freebasic-portal.de/freebasicru/user-files/visg.zip