Pelles C forum

Pelles C forum => General discussion => Topic started by: risanchez on December 01, 2020, 11:06:43 PM

Title: Pelles c version 10
Post by: risanchez on December 01, 2020, 11:06:43 PM
In version 10 of Pelles c I can not return a function from within another function, always get this:
fatal error: Internal error: 'Access violation' at 0x00007ff7b3897b6a.

This did not happen in version 9. Also I run my program in Visual Studio and compile and run ok.
Anybody, please kown how to solve this problem, if smobody face the same problem?
Thanks
Title: Re: Pelles c version 10
Post by: frankie on December 02, 2020, 12:54:00 AM
Not clear what you mean.
The error is from the compiler or from your code?
Post your code, a small sample that shows the problem.
Title: Re: Pelles c version 10
Post by: Grincheux on December 05, 2020, 06:58:38 PM
I never met this problem.
Title: Re: Pelles c version 10
Post by: MrBcx on December 05, 2020, 07:45:08 PM
In version 10 of Pelles c I can not return a function from within another function, always get this:
fatal error: Internal error: 'Access violation' at 0x00007ff7b3897b6a.

This did not happen in version 9. Also I run my program in Visual Studio and compile and run ok.
Anybody, please kown how to solve this problem, if [somebody] face the same problem?
Thanks

You need to post a small example that demonstrates the error.  Otherwise, it is impossible to know
what problem needs to be solved. 
Title: Re: Pelles c version 10
Post by: Grincheux on December 05, 2020, 08:27:09 PM
Is it like this :

Code: [Select]
lstrcpyA(szStringC,lstrcpyA(szStringA,szStringB)) ;
or

Code: [Select]
UpdateWindow(CreateWindowA(szProgramClass,szProgramTitle,
      WS_BORDER|WS_CAPTION|WS_SYSMENU|WS_POPUP,
      0,0,800,400,NULL,NULL,hInstance,NULL)) ;
Title: Re: Pelles c version 10
Post by: John Z on December 05, 2020, 09:17:44 PM
Hi,

Quite possibly this is related to this bug report:
https://forum.pellesc.de/index.php?topic=9770.msg32753#msg32753

To see if it is, try adding some additional parenthesis like

Code: [Select]
lstrcpyA(szStringC,(lstrcpyA(szStringA,szStringB))) ;

see if that helps. 
Otherwise you need to breakout the internal result into a variable and use that in the function.

John Z
Title: MOVED: Compiler bug interpreting function call from function pointer returned by another function.
Post by: frankie on January 09, 2021, 04:03:26 PM
This topic has been moved to Bug reports (https://forum.pellesc.de/index.php?board=3.0).

https://forum.pellesc.de/index.php?topic=9956.0