Version 6.0, Release Candidate #1 available

Started by Pelle, May 02, 2009, 12:12:08 PM

Previous topic - Next topic

Romashka

When I compile any application (even 'Hello world!') with DLL runtime I get a message that entry point to _except_handler3 cannot be found in pocrt.dll  :o
Any ideas why?

Pelle

JohnF: OK. Sorry if this caused you trouble, but I belive the current behavior is/should be more correct.

jwzumwalt: Thanks. Yes, it's generally a very nice group. I will try to continue this project as long as I can (or as long as there appear to be some interest in it)...

Romashka: No idea, really. I just tried a small test-program with structured exception handling and the C runtime DLL, and that worked. Do you have any more information? X86 build, I guess? Any special compiler options, linker libraries, etc?
/Pelle

Romashka

Quote from: Pelle on May 02, 2009, 07:40:01 PM
No idea, really. I just tried a small test-program with structured exception handling and the C runtime DLL, and that worked. Do you have any more information? X86 build, I guess? Any special compiler options, linker libraries, etc?

Yes, 32bit x86. Console app (win32 apps have same issue).
int main(void) { return 0; }

from .ppj:
CCFLAGS =  -Tx86-coff -MD -Ot -Ob1 -fp:precise -W1 -Gd #
ASFLAGS =  -AIA32 -Gd #
LINKFLAGS =  -subsystem:console -machine:x86 -release  kernel32.lib advapi32.lib delayimp.lib#


Pelle

Quote from: Romashka on May 02, 2009, 07:52:36 PM
Yes, 32bit x86. Console app (win32 apps have same issue).
Hmm... I created a new console project, pasted the code (just in case), and also the compiler and linker options ("Macros" tab). When I build the project, it works fine here.
/Pelle

JohnF

Pelle,

===========
JohnF: OK. Sorry if this caused you trouble, but I belive the current behavior is/should be more correct.
===========

No problem really, easily sorted. Thanks for the new version.

John

dancho

heya Pelle,
thx for the new release ...

It seems that I found 5 lines of code that crashes Pelles C,let me explain my steps:
1.File->New->Project->Win32Console Program->Create
2.File->New->Source Code
3.Save&Add to Project as main.c
4.code:
#include <stdio.h>
int main()
{
int c='d';
printf(":%c:\n",c);

return 0;
}

5.compile,link,run and for the first time everything work fine,but
6.when I try to change something in code or close Ide ( or everything else really ) this message box appear
7."error writting to file 'main.c"
  "The Process cannot access the file because it is being used by another process."
8. :)
9.btw Avira is finding this in the download link "DR/Zlob.Gen",false alaram I hope  ;)



Robert

#21
Using Pelles C X64 version 6.0, Release Candidate #1

This line

printf("%s% d%s% d%s","[lines In:",(int)LinesRead,"] [lines Out:",(int)gLinesWritten,"] ");

produces this warning

warning #2234:
Argument 3 to 'printf' does not match the format string;
expected 'char *' but found 'int'.

This line

printf("%s% d%s% .7G%s\n","[Statements:",(int)Statements,"] [Time:",(float)Elapsed," sec's]");

warning #2234:
Argument 3 to 'printf' does not match the format string;
expected 'char *' but found 'int'.

Robert Wishlaw

JohnF

Try it like this.


int gLinesWritten, LinesRead, Statements;
float Elapsed;

printf("%s %d %s %d %s","[lines In:",(int)LinesRead,"] [lines Out:",
(int)gLinesWritten,"] ");


printf("%s %d %s %.7G %s\n","[Statements:",(int)Statements,"] [Time:",
(float)Elapsed," sec's]");


John

Pelle

Quote from: dancho on May 03, 2009, 10:48:00 AM
It seems that I found 5 lines of code that crashes Pelles C,let me explain my steps:
I suspect your definition of "crash" is rather different from mine.

The problem is with "browse information" and the ' character; most C programmers would probably write int c='d'; with spaces, to make it more readable: int c = 'd';
If you make this change it will work for now (until the bug is fixed).

I'm pretty sure I've never heard of Avira, are you sure it's working?!
/Pelle

Robert

#24
Quote from: JohnF on May 04, 2009, 08:45:24 AM
Try it like this.


int gLinesWritten, LinesRead, Statements;
float Elapsed;

printf("%s %d %s %d %s","[lines In:",(int)LinesRead,"] [lines Out:",
(int)gLinesWritten,"] ");


printf("%s %d %s %.7G %s\n","[Statements:",(int)Statements,"] [Time:",
(float)Elapsed," sec's]");


John


Hi John:

I suspect that, because of my poor example, you are missing my point. Here's a pair of better examples.


This code



#include <stdio.h>

int main(int argc, char *argv[])
{
  printf("%s% d%s% d%s\n","Negative: ",-12345," Check alignment?  ",67890," Yes");
  printf("%s% d%s% d%s\n","Positive: ", 12345," Correctly aligned?",67890," Yes");
  return 0;
}



correctly formats the output so that it is properly aligned



Negative: -12345 Check alignment?   67890 Yes
Positive:  12345 Correctly aligned? 67890 Yes




but an improper warning is issued, that is,

snip.c(5): warning #2234:
Argument 3 to 'printf' does not match the format string;
expected 'char *' but found 'int'.

snip.c(6): warning #2234:
Argument 3 to 'printf' does not match the format string;
expected 'char *' but found 'int'.


This code, adapted from your suggested solution to the problem, does not issue a warning



#include <stdio.h>

int main(int argc, char *argv[])
{
  printf("%s %d %s %d %s\n","Negative: ",-12345," Check alignment?  ",67890," Yes");
  printf("%s %d %s %d %s\n","Positive: ", 12345," Correctly aligned?",67890," No");
  return 0;
}



however, it does not format for the desired alignment.



Negative:  -12345  Check alignment?   67890  Yes
Positive:  12345  Correctly aligned? 67890  No



I hope that I have made my point understandable.

Robert Wishlaw

JohnF

#25
You will have to rethink your alignment method.

The point is the character after % is the control, in various places you have a space directly after the %, this will not do.

EDIT:

For example

%s% d - no good

% s % d - no good

%s %d - good

%s%d - good

John

Robert

Quote from: JohnF on May 04, 2009, 10:55:22 PM
You will have to rethink your alignment method.

The point is the character after % is the control, in various places you have a space directly after the %, this will not do.

EDIT:

For example

%s% d - no good

% s % d - no good

%s %d - good

%s%d - good

John


John, the space following the % is a flag described in the flag characters and their meanings description on the fprintf function page of the Pelle's C Help file.

The Pelle's C Help file states that when a space follows the %, "If the first character of a signed conversion is not a sign, or if a signed conversion results in no characters, a space is prefixed to the result. If the space and + flags both appear, the space flag is ignored."

Robert Wishlaw



JohnF

#27
I didn't know about that.

However, the normal way of alignment is to use spaces and tabs to achieve what you want

%s     \t      %d

Obviously if it is a bug Pelle should look at it.

John

Christian

@Pelle & dancho:

I am a user of Avira Professional and I had no alerts.

@ Pelle: Avira is an antivirus solution which is prosperous in Germany. www.avira.com
www.pellesc.de - German PellesC mirror (now available in german and english)

Pelle

@Robert: OK, I see your point now. Yes, it's a bug - the compiler is currently looking for +, -, #, 0 - but I forgot the space (which I apparently never use myself). This will be fixed; either in RC2 or the official release, depeneding on other bug reports...

@Christian: OK, thanks for the info. ( I subscribe to another, usually top-ranking, antivirus solution, so viruses should not be an issue; let's leave it at that... )
/Pelle