Pelles C forum

Pelles C => Bug reports => Topic started by: frankie on March 26, 2023, 02:52:33 PM

Title: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: frankie on March 26, 2023, 02:52:33 PM
The intrinsic function
Code: [Select]
_INTRIN_X86_X64_(void __unreachable(void)) is still defined in the header intrin.h while it has been coded as  intrinsic since PelleC-V11.
A compilation including the header generate the following error:
Quote
PellesC\Include\intrin.h(218): error #2119: Redeclaration of '__unreachable', previously declared at <no source>.
Title: Re: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: Pelle on March 26, 2023, 04:06:08 PM
Right. For some reason I can't reproduce the error right now, but __unreachable() changed from being an intrinsic and shouldn't be in <intrin.h> (it's now internally a "generic function", and don't need a header at all).
Title: Re: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: John Z on March 30, 2023, 03:09:50 PM
V12RC1 on Windows 11 installed perfectly.

I also do get the previously mentioned
Code: [Select]
PellesC_v12\Include\intrin.h(218): error #2119: Redeclaration of '__unreachable', previously declared at <no source>. error message.
Here are the includes used:
Code: [Select]
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <intrin.h> // for tick counter value
#include <wchar.h>

BOOL ChkLogExist(char *p_fname);
void GetTime(char *p_time);
void GetTicks(char *p_tick);

New 'Project - 'Add' mode worked very well.  I'm locking my add-in post (and pulling source) since intrinsic copy mode is implemented in V12  :)  Results look identical  ;)

John Z

Maybe unhelpful but searching .h files:
Code: [Select]
V12RC1
Find "__unreachable".
"C:\Program Files\PellesC_V12\Include\intrin.h" (218) _INTRIN_X86_X64_(void __unreachable(void))
"C:\Program Files\PellesC_V12\Include\stddef.h" (24) #define unreachable()  __unreachable()
2 hit(s)

V11.002
Find "__unreachable".
"C:\Program Files\PellesC_V11\Include\intrin.h" (222) _INTRIN_ALL_(void __unreachable(void))
1 hit(s)
Title: Re: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: Pelle on March 30, 2023, 05:21:53 PM
I also do get the previously mentioned
Code: [Select]
PellesC_v12\Include\intrin.h(218): error #2119: Redeclaration of '__unreachable', previously declared at <no source>. error message.
I assume it's already fixed, but I still can't reproduce this error (with RC1). Do you have the compiler options used? (I guess the CCFLAGS project macro is enough...)
Title: Re: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: John Z on March 30, 2023, 06:11:08 PM
here they are, extracted from the ppj -
Code: [Select]
CCFLAGS = -Tx86-coff -std:C11 -Ot -Ox -Ob1 -fp:fast -W2 -Gz -Ze -Dunicode -D_unicode -D_WIN32 -DWIN32 -DUNICODE_SUPPORT -DWINDLL -DOUT#
ASFLAGS = -AIA32 -Gz#
RCFLAGS = -DUNICODE -D_UNICODE#
LINKFLAGS = -machine:x86 -subsystem:windows -largeaddressaware -safeseh -version:3.0 kernel32.lib user32.lib gdi32.lib gdiplus.lib comctl32.lib comdlg32.lib advapi32.lib shell32.lib HtmlHelp.lib delayimp.lib winmm.lib ole32.lib oleaut32.lib olepro32.lib uuid.lib version.lib Shlwapi.lib libxlsxio_write.lib UxTheme.lib#
SIGNFLAGS = -location:CU -store:MY -timeurl:http://timestamp.verisign.com/scripts/timstamp.dll -errkill#
INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#
WizCreator = Pelle Orinius#

If easier I can post picture, or entire ppj..

John Z
Title: Re: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: Pelle on April 01, 2023, 07:54:05 PM
OK, you need to use a "Win32" (X86) project with a calling convention other than __cdecl to trigger this.
My fix to remove (or comment out) line 218 of <intrin.h>
Code: [Select]
_INTRIN_X86_X64_(void __unreachable(void)) is correct.

I'm not going to upload RC2 just for this and a few typos in the help file. I will wait a few more weeks/month to see if anything more serious pops up, otherwise I will consider this version done (and upload the final version)...
Title: Re: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h
Post by: John Z on April 01, 2023, 09:40:52 PM
Makes sense to me. Testers can comment it out or switch calling convention to continue testing if they run into the error message.


John Z