NO

Author Topic: Cannot save files in OEM encoding; false warning for printf  (Read 3710 times)

kolo32

  • Guest
Cannot save files in OEM encoding; false warning for printf
« on: August 24, 2011, 04:06:56 PM »
First, thank you very much for the great development toolkit!

There is a minor bug in IDE (version 6.50.8 RC #4 Win64). Take any file in ANSI encoding and choose File > Properties > Source > Encoding = OEM. Press Ctrl+S. Pelles IDE will show a message box: "Error writing to file 'pelles_test.c'. Invalid or unknown file format." and the file will be deleted.

Expected result: the file should be saved in OEM encoding.

Another minor problem. If you choose warning level 2 in project settings, Pelles reports "The return value from 'printf' is never used" for any occurrence of printf (because most people never use the return value from the printf function).

I solved the problem by defining:

#define printf (void)printf


but it would be helpful if you turn the warning off for printf by default.

Thank you again.

CommonTater

  • Guest
Re: Cannot save files in OEM encoding; false warning for printf
« Reply #1 on: August 24, 2011, 04:22:05 PM »
First, thank you very much for the great development toolkit!

There is a minor bug in IDE (version 6.50.8 RC #4 Win64). Take any file in ANSI encoding and choose File > Properties > Source > Encoding = OEM. Press Ctrl+S. Pelles IDE will show a message box: "Error writing to file 'pelles_test.c'. Invalid or unknown file format." and the file will be deleted.

Expected result: the file should be saved in OEM encoding.

Or at least not deleted ... that is nasty.  Do note however that OEM is not an option for saving source files in the main tools->options dialog.

Quote
Another minor problem. If you choose warning level 2 in project settings, Pelles reports "The return value from 'printf' is never used" for any occurrence of printf (because most people never use the return value from the printf function).

I solved the problem by defining:

#define printf (void)printf


but it would be helpful if you turn the warning off for printf by default.

Thank you again.

This on you can handle with a #pragma ( warn disable : ##### )  at the top of your source file... 
Details at: help->contents->command line tools->pocc compiler-> compiler pragmas

kolo32

  • Guest
Re: Cannot save files in OEM encoding; false warning for printf
« Reply #2 on: August 25, 2011, 02:53:34 AM »
Or at least not deleted ... that is nasty.

Fully agreed.

This on you can handle with a #pragma ( warn disable : ##### )  at the top of your source file... 

Thanks, but I want to disable the warning only for printf. It's useful for other functions.
« Last Edit: August 25, 2011, 02:58:10 AM by kolo32 »

CommonTater

  • Guest
Re: Cannot save files in OEM encoding; false warning for printf
« Reply #3 on: August 25, 2011, 05:07:47 AM »
Well... you could just ignore the printf warning... That is to say I wouldn't label that a bug, merely an annoyance, and there's lots of that around computers  :o