NO

Author Topic: Version 6.0, Release Candidate #1 available  (Read 51085 times)

Romashka

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #15 on: May 02, 2009, 07:22:17 PM »
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?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 6.0, Release Candidate #1 available
« Reply #16 on: May 02, 2009, 07:40:01 PM »
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

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #17 on: May 02, 2009, 07:52:36 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).
Code: [Select]
int main(void) { return 0; }
from .ppj:
Code: [Select]
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#

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 6.0, Release Candidate #1 available
« Reply #18 on: May 02, 2009, 08:11:26 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

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #19 on: May 02, 2009, 09:31:38 PM »
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

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #20 on: May 03, 2009, 10:48:00 AM »
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:
Code: [Select]
#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  ;)



Offline Robert

  • Member
  • *
  • Posts: 247
Re: Version 6.0, Release Candidate #1 available
« Reply #21 on: May 04, 2009, 07:52:47 AM »
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
« Last Edit: May 04, 2009, 07:55:13 AM by Robert »

JohnF

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #22 on: May 04, 2009, 08:45:24 AM »
Try it like this.

Code: [Select]
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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 6.0, Release Candidate #1 available
« Reply #23 on: May 04, 2009, 08:53:47 PM »
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

Offline Robert

  • Member
  • *
  • Posts: 247
Re: Version 6.0, Release Candidate #1 available
« Reply #24 on: May 04, 2009, 10:17:18 PM »
Try it like this.

Code: [Select]
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

Code: [Select]

#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

Code: [Select]

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

Code: [Select]

#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.

Code: [Select]

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


I hope that I have made my point understandable.

Robert Wishlaw
« Last Edit: May 04, 2009, 10:21:03 PM by Robert »

JohnF

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #25 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
« Last Edit: May 04, 2009, 11:05:50 PM by JohnF »

Offline Robert

  • Member
  • *
  • Posts: 247
Re: Version 6.0, Release Candidate #1 available
« Reply #26 on: May 05, 2009, 12:23:20 AM »
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

  • Guest
Re: Version 6.0, Release Candidate #1 available
« Reply #27 on: May 05, 2009, 08:23:43 AM »
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
« Last Edit: May 05, 2009, 08:32:06 AM by JohnF »

Offline Christian

  • Administrator
  • Member
  • *****
  • Posts: 148
    • http://www.pellesc.de
Re: Version 6.0, Release Candidate #1 available
« Reply #28 on: May 05, 2009, 09:51:07 AM »
@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)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 6.0, Release Candidate #1 available
« Reply #29 on: May 05, 2009, 04:53:39 PM »
@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