Pelles C forum

Pelles C => Feature requests => Topic started by: CandCPlusPlus on August 09, 2022, 05:46:58 PM

Title: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 09, 2022, 05:46:58 PM
Suggestions. Many Suggestions. I decided to post this all into one single thread. Otherwise, it would clutter this section of the forum and I'll number them all so that people responding can mention it by number.

1. Giving macros called in the code and the macro itself a different color from other code and add it to the "Color and Fonts" section of the enviroment settings. The individual color for macros exists in Visual Studio and it's nice for being able tell what is and what isn't a macro. One could even give the code for structs a particular color as well?

2. Unicode/ASCII selection for Windows API and C in the project settings. Default to unicode for new projects since almost everything is unicode nowadays? I have to remember set the unicode statements for every project, especially Windows projects.

3. I need to add "#Define __STDC_WANT_LIB_EXT1__ 1" in order to use the secure functions. Should this be in project settings and enabled by default for new projects? I believe the Visual Studio compiler even blocks the insecure C functions by default.

Edit: This is by design apparently, this is a part of the C standards.

4. A setting in options to adjust default folder for saving new projects. I don't see a place to change it anywhere in the GUI but I could be missing it.

5. Pelles C defaulting to settings that allow debugging out of the box. I have to adjust the compiler settings to use debugging whenever I install Pelles C anywhere. Not a huge problem but it would be nice for it work out of the box. Though, there could be a reason that it's setup this way that I'm not aware of.

Edit: Whenever I create a new project I need to go to the "Compiler" page to change "Debug information" to "Full" and I need to go to the "Linker" page to change "Debug information" to "Pelles C format". This is all in the project settings. Otherwise, I will get a message about the lack of debug information.


6. The help content in Pelles C appears to mostly be content about the C Standard Library. The entire of documentation of the Windows API is now available from Microsoft on Github under the MIT license. It's in markdown format but imagine it could be converted to the Microsoft (CHM) HTML help. I'm not a lawyer but all it says to do is to credit Microsoft which is easy. I still do like offline documentation even in today's world. It's nice when your internet connection goes "poof" and it would be nice to have it built into the Pelles C UI and the installer.
https://github.com/MicrosoftDocs/win32

Edit: The Microsoft open source help content is a mess. Perhaps a tool to integrate the old style document explorer offline help content into the Pelles C instead? A link to what I've found so far:
https://forum.pellesc.de/index.php?topic=10589.msg36853

7. Related to documentation, it would be convenient if you could just press a keyboard shortcut and it would bring you straight to the built in help content of the particular C Standard Library or Windows API function that the cursor is at.

8. There are function call tips provided by Pelles C after you type the entire name of the function. These tips dissappear if you move the cursor to elsewhere and do not reappear when I later go back to change or complete the function call code. I wish the functions tips would reappear when the cursor or mouse is inside the function code.

9. Memory leak detector, GDI and USER object leak detector, likely a job fit for an add-in?

10. Breakpoints only work within function calls and variables from outside a function. It would be good to be able set breakpoints in code contained entirely within a single function (well, at least, I haven't been able to do so without errors). I imagine that it could be a huge undertaking to enhance the debugger though.


It's says a lot that after using Pelles C for a little while, I'm finding it really hard to think of any more features or suggestions beyond this and some of these are rather minor. The debugger improvements are likely to be the biggest undertaking, to the point that it may not be viable but that's my guess. :)
Title: Re: Suggestsion, Many Suggestions
Post by: CandCPlusPlus on August 10, 2022, 02:07:53 AM
11. I thought of a major suggestion. ARM64 support. An ARM64 build of Pelles C? Possibly even support for compiling for ARM64 on Intel/AMD x64 CPUs (and x64 Pelles C)? Microsoft is really increasing their support of ARM64.

12.  Add comment and uncomment code buttons to the toolbar. I'm quite used to this in Visual Studio. I discovered that you can right click in Pelles C to get a context menu with comment and uncomment button but it would be more convenient to have it in the toolbar.

13. An autocomplete for Windows API functions, the C Standard Library and perhaps even functions in a project's code. Autocomplete could, at least, in theory, be easier to implement in C with "mere" functions and structures. I have noticed that Pelles C already has autocomplete for structs.

14. A way to add and modify the properties for a file to be compiled. Windows shows the file version, properties and everything for many files when you click properties and than details. It's useful for tracking which version an executable is when on one of my computers. It's all blank for files compiled with Pelles C.

15.  Buffer overflow detection and warnings when trying to compile or execute.

Edit: This partially exists when warning level 2 is selected in Pelles C. Stack overflows are detected for stack allocated arrays but *not* for heap allocated arrays or memory.

16. A replace all in selection only option in the Replace dialog.

17. Compiler warnings for assignments in if statements, accidentally using "=" instead of "==". Add possible option in settings for how to handle this?

18. Putting Pelles C on the Microsoft Store?

19. An option for Control Flow Guard (and other Windows security features) ?
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 10, 2022, 12:01:52 PM
Hi CandCPlusPlus,

Welcome to the forum!


Suggestions. Many Suggestions. I decided to post this all into one single thread. Otherwise, it would clutter this section of the forum and I'll number them all so that people responding can mention it by number.

Well - pros and cons in doing it this way.  Yes less entries but harder to track all inputs on a particular item, also people interested in only one or two will need to wade through it all....  IMO

4. A setting in options to adjust default folder for saving new projects. I don't see a place to change it anywhere in the GUI but I could be missing it.
When you create a new project you have the option of putting it anywhere you want by changing the path in the Location dialog edit box at the bottom of the New Project window.

5. Pelles C defaulting to settings that allow debugging out of the box. I have to adjust the compiler settings to use debugging whenever I install Pelles C anywhere. Not a huge problem but it would be nice for it work out of the box. Though, there could be a reason that it's setup this way that I'm not aware of.
Not sure what this means - is it different from using Project Modes?

7. Related to documentation, it would be convenient if you could just press a keyboard shortcut and it would bring you straight to the built in help content of the particular C Standard Library or Windows API function that the cursor is at.

At least for part of this try using F1 on any highlighted key word to open the help for that function, and the include file it is in.

John Z
Title: Re: Suggestions, Many Suggestions
Post by: TimoVJL on August 10, 2022, 12:28:29 PM
The poide have an Add-In interface and it can handle additional F1 usage.
In Add-Ins section are many examples of additional help searchings for WSDK.

One example for testing:
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#define UNICODE /* for Windows API */
#define _UNICODE    /* for C runtime */
#include <windows.h>
//#include <windowsx.h>
#include <htmlhelp.h>
#include <tchar.h>
#include <addin.h>

#pragma comment(lib, "htmlhelp.lib")

// Locals.
static HANDLE g_hmod = NULL;
static TCHAR szHelp[MAX_PATH];

BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved)
{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:
            g_hmod = hDLL;
            return TRUE;

        case DLL_PROCESS_DETACH:
            return TRUE;

        default:
            return TRUE;
    }
}

ADDINAPI BOOL WINAPI AddInMain(HWND hwnd, ADDIN_EVENT eEvent)
{
    switch (eEvent)
    {
        case AIE_APP_CREATE:
AddIn_GetIDEFolder(hwnd, ADDIN_FOLDER_HELP, szHelp, sizeof(szHelp));
lstrcat(szHelp, TEXT("\\AddIn.chm"));
            return TRUE;

        case AIE_APP_DESTROY:
            return TRUE;

        default:
            return TRUE;
    }
}

BOOL HelpSearch(HWND hwnd, TCHAR *wcKey);

ADDINAPI BOOL WINAPI AddInHelp(HWND hwnd, ADDIN_HELPEVENT eEvent, LPCVOID pcvData)
{
if (eEvent == AIHE_SRC_KEYWORD_FIRST)
return FALSE;
return HelpSearch(hwnd, (TCHAR*)pcvData);
}

BOOL HelpSearch(HWND hwnd, TCHAR *szKey)
{
TCHAR szTmp[512];
HH_AKLINK aklnk = {0};
aklnk.cbStruct = sizeof(HH_AKLINK);
aklnk.pszKeywords = szKey;
//aklnk.fIndexOnFail = TRUE;
wsprintf(szTmp, TEXT("%s macro;%s function;%s structure"), szKey, szKey, szKey);
aklnk.pszKeywords = szTmp;
if (HtmlHelp(hwnd, szHelp, HH_KEYWORD_LOOKUP, (UINT_PTR)&aklnk) != NULL) {
return TRUE;
}
return FALSE;
}
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 10, 2022, 09:01:06 PM
Quote
Well - pros and cons in doing it this way.  Yes less entries but harder to track all inputs on a particular item, also people interested in only one or two will need to wade through it all....  IMO

True. I had not thought of the cons of putting it all into one thread. I may create a second or even third thread if one of the suggestions gets lots of replies. :)

Quote
Not sure what this means - is it different from using Project Modes?

Whenever I create a new project I need to go to the "Compiler" page to change "Debug information" to "Full" and I need to go to the "Linker" page to change "Debug information" to "Pelles C format". This is all in the project settings. Otherwise, I will get a message about the lack of debug information.
Title: Re: Suggestions, Many Suggestions
Post by: frankie on August 12, 2022, 12:02:00 PM
PellesC IDE is extensible through the use of addins and wizards that anybody can write using the IDE addin API (see help file).
There is a lot of addins here (https://forum.pellesc.de/index.php?board=13.0). While I'm sure you'll find some that fits your requests (i.e. my addin for help here (https://forum.pellesc.de/index.php?topic=7250.msg27566#msg27566), use the online option to select a word and then using F1 search MSDN online help), you can have a look as examples for addin coding.
The wizards allows you to specify a personal project type, i.e. ready for debug. You can find examples on Pelle site (http://www.smorgasbordet.com/pellesc/sourcecode.htm). Browse Extending the IDE -> Project Wizards for examples.
It would be nice if you would share your code with us to add new functionalities to the IDE.
Title: Re: Suggestions, Many Suggestions
Post by: TimoVJL on August 12, 2022, 01:33:38 PM
A one project was Add-In loader for Add-ins
https://forum.pellesc.de/index.php?topic=8153.0

In git
Tiny Lousy PellesC-Add-Ins (https://github.com/TimoVJL/PellesC-Add-Ins)
Title: Re: Suggestions, Many Suggestions
Post by: frankie on August 12, 2022, 02:38:05 PM
In git
Tiny Lousy PellesC-Add-Ins (https://github.com/TimoVJL/PellesC-Add-Ins)
Nice job Timo!  :D
Starred  ;)
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 14, 2022, 04:00:35 PM
In git
Tiny Lousy PellesC-Add-Ins (https://github.com/TimoVJL/PellesC-Add-Ins)

Well if these are considered 'lousy' then the rest of us might as well give up  :) 

John Z
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 14, 2022, 04:10:10 PM
3. I need to add "#Define __STDC_WANT_LIB_EXT1__ 1" in order to use secure functions. Should this be in project settings and enabled by default for new projects? I believe the Visual Studio compiler even blocks the insecure C functions by default.

I don't think this is true in Pelles C.  You can use safe(r) string functions w/o this define, are there other functions?
Does Visual Studio block the use of free(pointer) or does it automatically assign NULL to the pointer after free?


John Z
Title: Re: Suggestions, Many Suggestions
Post by: frankie on August 15, 2022, 01:19:47 AM
PellesC requires the definition of macro __STDC_WANT_LIB_EXT1__ to '1', as indicated in C11 standard annex k3.
Anyway the standard at paragraph K3.1.1 Standard Headers point 3 says:
Quote
It is implementation-defined whether the functions, macros, and types declared or defined in K.3 and its subclauses are declared or defined by their respective headers if _ _STDC_WANT_LIB_EXT1_ _ is not defined as a macro at the point in the source file where the appropriate header is first included.
I remember that GCC works the same way.
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 15, 2022, 02:54:11 AM
PellesC requires the definition of macro __STDC_WANT_LIB_EXT1__ to '1', as indicated in C11 standard annex k3.

You are absolutely right, I'm sorry my BAD test, I added to existing source code a strcat_s and it worked.  Nowhere there did I define the safe flag __STDC_WANT_LIB_EXT1__ .  However when compiling the entire code (45 files) to run the embedded test I had defined it in a json parsing module.  Shows the benefit of using the smallest code possible needed to test something not some humongous program where a test is inserted. Lesson learned....

Apologies,
John Z
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 15, 2022, 05:50:36 AM
My original post was poorly worded there.

You can use the secure functions without the define statement BUT I do get sporadic compiler warnings about the function being undefined which is annoying. It's a minor annoyance because all I need to do is define "__STDC_WANT_LIB_EXT1__" to stop the warnings and apparently it's a part of the standard which means it's likely to stay as is unless the standards change.  You could get around that by including it by default with the new project templates but, again, it's minor and not that important. :)

If it's a part of the standard, perhaps the fact that it works with sporadic warnings is a bug in itself.

On another note, I swear Visual Studio blocked the less secure functions but it doesn't appear to anymore.
Title: Re: Suggestions, Many Suggestions
Post by: frankie on August 15, 2022, 12:18:21 PM
My original post was poorly worded there.

You can use the secure functions without the define statement BUT I do get sporadic compiler warnings about the function being undefined which is annoying. It's a minor annoyance because all I need to do is define "__STDC_WANT_LIB_EXT1__" to stop the warnings and apparently it's a part of the standard which means it's likely to stay as is unless the standards change.  You could get around that by including it by default with the new project templates but, again, it's minor and not that important. :)

If it's a part of the standard, perhaps the fact that it works with sporadic warnings is a bug in itself.

On another note, I swear Visual Studio blocked the less secure functions but it doesn't appear to anymore.
The macro "__STDC_WANT_LIB_EXT1__", when set to 1, enables the emission of the prototypes for the secure functions (see annex K), while the secure functions themselves are in any case present in the runtime libraries.
This means that if you don't enable prototypes, setting "__STDC_WANT_LIB_EXT1__" to 1, you'll get warnings from compiler, but the secure functions gets linked anyway.
Of course without prototypes you'll lost error detection and automatic type conversion (between compatible types) operated by the compiler, and this could lead to very bad problems. In any case it is definitely a bad programming practice.
Finally this is not a bug, but a fully compliant behavior.  ;)
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 16, 2022, 03:32:07 PM

6. The help content in Pelles C appears to mostly be content about the C Standard Library. The entire of documentation of the Windows API is now available from Microsoft on Github under the MIT license. It's in markdown format but imagine it could be converted to the Microsoft (CHM) HTML help. I'm not a lawyer but all it says to do is to credit Microsoft which is easy. I still do like offline documentation even in today's world. It's nice when your internet connection goes "poof" and it would be nice to have it built into the Pelles C UI and the installer.
https://github.com/MicrosoftDocs/win32

Seems possible.  It would be several (many) months (at least) of work.  I made a small trial, attached.
The markdown also seems to reference some 'links' like:
    href: /windows/desktop/api/Commctrl/nf-commctrl-animate_close
which don't exist in the github markdown repository, and don't exist on my system, so these would take more time to ferret out. 

Finally just to mention the markdown comprises over 400Megabytes of data.  Just doing the section on Controls - just the A's into .chm resulted in a 110K file.  I don't know the upper limit of a .chm file.  BTW the A's only processed 111 lines out of 6884 lines of the controls TOC.

The Github markdown can be dowloaded and used 'offline' as well.  So I'm not sure if there is enough demand for a .chm version. 

John Z

Note just FYI - you can't open .chm over the network so you must download to look at it.

Update: Just a quick build of the controls section w/o frills resulted in a almost 20Meg chm file before compression then about 4.5Megs final. Approx 1760 HTML files...

Update: Full Controls.chm now available on SourceForge @ https://sourceforge.net/projects/windows-controls-api-docs/
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 16, 2022, 06:13:44 PM

Seems possible.  It would be several (many) months (at least) of work.  I made a small trial, attached.
The markdown also seems to reference some 'links' like:
    href: /windows/desktop/api/Commctrl/nf-commctrl-animate_close
which don't exist in the github markdown repository, and don't exist on my system, so these would take more time to ferret out. 

Finally just to mention the markdown comprises over 400Megabytes of data.  Just doing the section on Controls - just the A's into .chm resulted in a 110K file.  I don't know the upper limit of a .chm file.  BTW the A's only processed 111 lines out of 6884 lines of the controls TOC.

The Github markdown can be dowloaded and used 'offline' as well.  So I'm not sure if there is enough demand for a .chm version. 

John Z

Note just FYI - you can't open .chm over the network so you must download to look at it.

Update: Just a quick build of the controls section w/o frills resulted in a almost 20Meg chm file before compression then about 4.5Megs final. Approx 1760 HTML files...

I think it would be far easier to create some tool to automate the process. A tool that could batch convert all of it. I was looking on the internet for tools like that. Converting tens of thousands of files individually would be a pain. The github docs are updated regularly so a tool to create updated chm files occasionally would be good.

I have looked around the internet for a tool to either convert github markdown to html or directly to chm. I haven't found any super easy tools to accomplish it yet. How did you convert it? :) The Microsoft CHM creator can import HTML but I doubt it supports markdown.
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 16, 2022, 06:16:53 PM
I saw information about how to create extensions mentioned. I assume this is related to my suggestion about a memory and resource leak detector.

I do think a resource leak detector would be an easy tool to make. The tool could display the amount of RAM in KB, MB or just bytes (probably should make that adjustable) and the number GDI and USER objects and handles used by the program. The tricky part could be creating a graph to display in the GUI of the tool and you may want to save a log to the disk while the program is running as an option, at least.

Finally this is not a bug, but a fully compliant behavior.  ;)

That would explain this behavior. I'm learning more about the C Standards. I should always be using that define statement when using any C library function with an "_s" at the end, basically? :)
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 16, 2022, 06:46:02 PM
The Github markdown can be dowloaded and used 'offline' as well.  So I'm not sure if there is enough demand for a .chm version. 

A chm file of all the help content would be nice but I was just thinking that one could completely take out that step entirely by using or creating a good application to view the markdown directly. A github markdown viewer application, basically. I'm making this more complicated than it needs to be. Perhaps even include it with Pelles C? Though, not really that necessary.

One could even create a markdown viewer that looks somewhat like the classic Microsoft CHM help and even move the existing Pelles C help content to that. Maybe even let you copy whatever custom content you want to a specific folder that Pelles C would than recognize. :)
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 16, 2022, 07:28:46 PM
I'll mention my ARM64 suggestion again. Microsoft partially ported Visual Studio to ARM64, recently. Visual Studio is huge though and Pelles C would be a better fit for ARM64, especially low end ARM64 tablets. An ARM64 build of Pelles C would be great. It would be good to be able compile for ARM64 even on an x64 version of Pelles C as well.
Title: Re: Suggestions, Many Suggestions
Post by: frankie on August 16, 2022, 08:32:31 PM
That would explain this behavior. I'm learning more about the C Standards. I should always be using that define statement when using any C library function with an "_s" at the end, basically? :)
Short answer: yes.

About having a local help set this actually is impracticable IMHO, there is so much stuff that would be a very large bulk of storage.
But a simple help of the basic core of WINAPI, the glorious (and no more supported hlp format) win32.hlp, can be found here (http://laurencejackson.com/win32/), translated to chm format by Laurence Jackson, thanks a lot for the conversion. You can add this file in the IDE, on menu click Tools->Customize select tab Help files, then add the file. It will be searched when pressing F1.

You can also use this addin (https://forum.pellesc.de/index.php?topic=7250.msg27566#msg27566) of mine. Don't care to build a local Help2 set (even MS abandoned it), but enable the online query search option. Now pressing F1, if no local entry is found, will be issued a query on microsoft online (maybe it needs some updating, but is still working).
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 16, 2022, 10:01:08 PM
About having a local help set this actually is impracticable IMHO, there is so much stuff that would be a very large bulk of storage.

All of the huge bulk of Windows API documentation could probably be trimmed down as well.

There are definitely obscure and rarely used parts of the Windows API with even some parts of it which are not really relevant nowadays. If I remember correctly, there are for example palette APIs for optimizing the appearance of applications on 256 color displays and that hasn't really been relevant since the 1990s. You definitely don't need that in the documentation unless you like reading about the history of Windows.
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 16, 2022, 10:24:26 PM

But a simple help of the basic core of WINAPI, the glorious (and no more supported hlp format) win32.hlp, can be found here (http://laurencejackson.com/win32/), translated to chm format by Laurence Jackson, thanks a lot for the conversion. You can add this file in the IDE, on menu click Tools->Customize select tab Help files, then add the file. It will be searched when pressing F1.
BTW The 'old' .hlp files, of which I have many, are still useful and usable in Windows 10 and 11.  Just download the .exe from here and install.  They work just like before.  Here is the link: https://www.majorgeeks.com/files/details/winhlp32_for_windows_10.html


I think it would be far easier to create some tool to automate the process. A tool that could batch convert all of it. I was looking on the internet for tools like that. Converting tens of thousands of files individually would be a pain. The github docs are updated regularly so a tool to create updated chm files occasionally would be good.
I mentioned converting 1760 files creating .chm file of 4.5 Megs - surely you don't think I did that by hand....

John Z
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 16, 2022, 10:27:49 PM
I mentioned converting 1760 files creating .chm file of 4.5 Megs - surely you don't think I did that by hand....

How did you do that? I'm curious now. :)
Title: Re: Suggestions, Many Suggestions
Post by: MrBcx on August 17, 2022, 01:21:18 AM
For most day-to-day offline WinApi lookups, this chm compiled by Lawrence Jackson in 2015 is still the best you'll find on the web.

http://laurencejackson.com/win32/

Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 17, 2022, 02:39:45 AM
I edited my second post to add a suggestion about adding comment and uncomment buttons to the toolbar. Visual Studio has that and I do miss it when using Pelles C.

When you create a new project you have the option of putting it anywhere you want by changing the path in the Location dialog edit box at the bottom of the New Project window.

My suggestion is to add a setting to the options dialog to adjust the default folder that appears in the New Project dialog when you click on New and than Project. Right now it just lists whatever folder was entered for a previous project. In the photo attached, the previous project was created in the Cat folder for example. It's somewhat minor though and not super important.
Title: Re: Suggestions, Many Suggestions
Post by: John Z on August 17, 2022, 12:18:42 PM
How did you do that? I'm curious now. :)

https://github.com/kevwan/mdconv

rem batch convert files in directory then delete md files
rem deleting .md because these are a copy, still have originals
rem change path to reflect md2html location
rem put batch file in directory to convert then run it
for %%i in (*.md) do C:\Temp\WinAPI_CHM\md2html -i %%~ni.md -o %%~ni.html
DEL *.md

John Z
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 26, 2022, 08:41:30 PM
I want to clarify my suggestion about tips, autocomplete and such. I think I'll modify my original post too.

I was basically suggesting an autocomplete for Windows API functions, the C Standard Library and perhaps even functions in a project's code. Autocomplete could in theory be easier to implement in C with mere functions and structures. I have noticed that Pelles C already has autocomplete for structs.
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on August 29, 2022, 06:49:08 PM
Another feature would be buffer overflow detection and warnings. I haven't noticed it in Pelles C, if it already exists in Pelles C.
Title: Re: Suggestsion, Many Suggestions
Post by: John Z on September 11, 2022, 03:35:30 PM
12.  Add comment and uncomment code buttons to the toolbar. I'm quite used to this in Visual Studio. I discovered that you can right click in Pelles C to get a context menu with comment and uncomment button but it would be more convenient to have it in the toolbar.

While I don't agree that using a toolbar button instead of the pop-up menu is easier, I do believe in "Each to their own the old lady said as she kissed the cow" so to respond to your request and to demonstrate the easy way this can be done I've created an Add-in to do it.
You can get it here:
https://forum.pellesc.de/index.php?topic=10582.0

It was a nice change after doing all that documentation work....but didn't take long  :)

John Z
Title: Re: Suggestsion, Many Suggestions
Post by: John Z on September 11, 2022, 03:43:10 PM
14. A way to add and modify the properties for a file to be compiled. Windows shows the file version, properties and everything for many files when you click properties and than details. It's useful for tracking which version an executable is when on one of my computers. It's all blank for files compiled with Pelles C.

You just need to add a Version resource.  Open the resource file right click in a open area and select  New then Version, it is all there.
There is also an add-in that would update automatically if you don't want to update yourself.  Called Increment-Build-Number I believe.

John Z
Title: Re: Suggestsion, Many Suggestions
Post by: CandCPlusPlus on October 02, 2022, 06:25:18 PM
While I don't agree that using a toolbar button instead of the pop-up menu is easier, I do believe in "Each to their own the old lady said as she kissed the cow" so to respond to your request and to demonstrate the easy way this can be done I've created an Add-in to do it.
You can get it here:
https://forum.pellesc.de/index.php?topic=10582.0

It was a nice change after doing all that documentation work....but didn't take long  :)

That's cool. The context menu can be easier or the toolbar buttons can be easier, depending on what I'm doing. I'm so used to seeing the comment and uncomment buttons in Visual Studio that it's jarring for it to be absent from the toolbar.

I really should learn about how to make add-ins and read the documentation. Pelles C appears to be quite extendable with the add-ins. I'll look at the source code. :)

You just need to add a Version resource.  Open the resource file right click in a open area and select  New then Version, it is all there.
There is also an add-in that would update automatically if you don't want to update yourself.  Called Increment-Build-Number I believe.

I learned about a feature in Pelles C today. I do use the resource editor and I didn't even think to explore what that version resource is.

It took me almost a month to reply to this. lol
Title: Re: Suggestsion, Many Suggestions
Post by: John Z on October 03, 2022, 11:23:29 AM
It took me almost a month to reply to this. lol

No worries - happy to help.

Some never return....

John Z
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on October 03, 2022, 10:00:33 PM
I attached an example of Autocomplete and the "function call hints" that are offered by Code::Blocks. I previously suggested this and I do noticed the lack of it all when using Pelles C. The "function call hints" reappear as soon as you return to typing the function call again in Code::Blocks. In Pelles C, they disappear and it's tricky to get it back.
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on October 04, 2022, 05:04:53 AM
I thought of a smaller suggestion, compiler warnings for assignments in if statements. Basically, warn of a single equal sign (assignment operator) exists by itself anywhere inside of an if statement. I experimented and Pelles C offers no warning for this.

The warnings that exist in for this Code::Blocks have saved me a bunch of troubleshooting at least once. lol
Title: Re: Suggestions, Many Suggestions
Post by: John Z on October 04, 2022, 01:30:20 PM
I thought of a smaller suggestion, compiler warnings for assignments in if statements. Basically, warn of a single equal sign (assignment operator) exists by itself anywhere inside of an if statement. I experimented and Pelles C offers no warning for this.

The warnings that exist in for this Code::Blocks have saved me a bunch of troubleshooting at least once. lol

Pelles Does support this warning.  Try turning on Level II compiler warnings.

Example:  if (a=5) {....;} generates this -
C:\Program Files\PellesC\Files\CopyMode\CopyMode.c(47): warning #2030: '=' used in a conditional expression.

John Z
Title: Re: Suggestions, Many Suggestions
Post by: John Z on October 04, 2022, 02:39:47 PM
5. Pelles C defaulting to settings that allow debugging out of the box. I have to adjust the compiler settings to use debugging whenever I install Pelles C anywhere. Not a huge problem but it would be nice for it work out of the box. Though, there could be a reason that it's setup this way that I'm not aware of.

Edit: Whenever I create a new project I need to go to the "Compiler" page to change "Debug information" to "Full" and I need to go to the "Linker" page to change "Debug information" to "Pelles C format". This is all in the project settings. Otherwise, I will get a message about the lack of debug information.

This is just not true.  The current version of Pelles C out of the box has two modes "Release" and "Debug" just pick the desired mode from the drop down at the top of the project IDE window. 

John Z
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on October 04, 2022, 07:24:46 PM

Pelles Does support this warning.  Try turning on Level II compiler warnings.

Example:  if (a=5) {....;} generates this -
C:\Program Files\PellesC\Files\CopyMode\CopyMode.c(47): warning #2030: '=' used in a conditional expression.

John Z

It does work. I crossed that off on the list and thanks for pointing that out. :)

This is just not true.  The current version of Pelles C out of the box has two modes "Release" and "Debug" just pick the desired mode from the drop down at the top of the project IDE window. 

You're correct. It does work in the newest versions. I crossed that out.
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on October 04, 2022, 07:37:42 PM
I'll cross off the suggestion for the uncomment and comment toolbar buttons since it's already in the add-ins section.

I'll cross off the suggestions for the Microsoft documentation considering the messy state the documentation is in and the huge challenge in creating offline content from the open source Microsoft documentation.

A possible way around this would be for a tool integrating old Microsoft Help Viewer and document explorer help content into Pelles C (in offline searchable and linkable form). I believe I've seen one on this site somewhere.

Pelles C even gives warnings for out of bounds stack allocated arrays when the warning level 2 is set. There are no warnings for heap allocated arrays and memory though.
Title: Re: Suggestions, Many Suggestions
Post by: CandCPlusPlus on October 26, 2022, 12:30:24 AM
This forum is rather quiet and Pelles C isn't well known. Perhaps putting Pelles C on the Microsoft Store would help? I'd still keep the download links at "http://www.smorgasbordet.com/pellesc/" because I personally am not keen about the Microsoft Store.