NO

Author Topic: PellesC V12RC1 function __unreachable() defined as intrinsic and in intrin.h  (Read 935 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2101
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>.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
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).
/Pelle

Offline John Z

  • Member
  • *
  • Posts: 807
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)
« Last Edit: March 30, 2023, 03:33:17 PM by John Z »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
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...)
/Pelle

Offline John Z

  • Member
  • *
  • Posts: 807
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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
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)...
/Pelle

Offline John Z

  • Member
  • *
  • Posts: 807
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
« Last Edit: April 02, 2023, 03:02:16 AM by John Z »