News:

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

Main Menu

Recent posts

#81
Expert questions / Re: swprintf question
Last post by John Z - June 22, 2025, 02:14:12 AM
Thanks for the explanation Pelle!

👍

John Z
#82
Expert questions / Re: swprintf question
Last post by Pelle - June 21, 2025, 03:58:30 PM
Quote from: John Z on June 21, 2025, 12:02:04 PMFeature or Bug  :)  ?
Yes.

For historical reasons in Microsoft mode, there is no diagnostic for the implicit conversion from -1 to -1U (or 0xFFFFFFFF...). A modern version of the MSVC compiler seems happy to complain here, so perhaps this should be changed.

Another chance to detect a problem with your code is in the static code analyzer (bounds checker). This fails because -1U in this case is reported internally as a store size of 0, meaning "don't know". This is a problem that should be fixed, if I can figure out an easy way to do so.

#83
Expert questions / Re: swprintf question
Last post by John Z - June 21, 2025, 03:13:34 PM
Hi Vortex,

Here is a mini project for it.

John Z
#84
Expert questions / Re: swprintf question
Last post by Vortex - June 21, 2025, 01:12:48 PM
Hi John,

Could you send the complete code here?
#85
Expert questions / swprintf question
Last post by John Z - June 21, 2025, 12:02:04 PM
An accidental deletion when cleaning up some code found that -

swprintf(zmsg,-1,L"%s",Info.Procedure);

does not raise an error or warning.  The original line was -

swprintf(zmsg,MaxZmsg-1,L"%s",Info.Procedure);

So looks like the -1 is interpreted as max int ?  This defeats the limit restriction I guess -

Both versions put the string into zmsg variable, which fortunately in this case is much larger than the incoming string would ever be so no overrun.

Feature or Bug  :)  ?

John Z
#86
Chit-Chat / Re: Pelle Orinius
Last post by Vortex - June 20, 2025, 08:39:23 PM
Hi Timo,

QuoteI didn't find any usable test packages for C language for testing.

You have a lot of Pelles C projects, aren't they a part of your personal test suite?
#87
Graphics programming / Re: Building Graphics Librarie...
Last post by TimoVJL - June 18, 2025, 01:20:47 PM
Just try harder, in the way that many of programmers have done in these years with Pelles C.
Once i tried to help compile Harbour with Pelles C, useless for me, but just to test, how C compiler variants differs.
I am now totally retired, so only cases, that i still see interesting, i try to help.
#88
Graphics programming / Re: Building Graphics Librarie...
Last post by kyga116 - June 18, 2025, 05:30:27 AM
Well, I couldn't get GLEW to work after two days of trying. I tried the online Glad generator and I was up and running in 5 minutes.  ::)
#89
Graphics programming / Re: Building Graphics Librarie...
Last post by TimoVJL - June 18, 2025, 03:00:37 AM
Sadly a that static library belongs to msvc.
#90
Graphics programming / Re: Building Graphics Librarie...
Last post by kyga116 - June 17, 2025, 07:56:12 PM
I was able to get rid of that in the compiler options. There's an "Enable Microsoft extensions" checkbox.

Now I'm getting a missing library error: LIBCMT.lib
Anyone know where this thing is supposed to come from?