NO

Author Topic: POCC5/AMD64: __WSAFDIsSet unresolved + Internal error: reduce_tree()  (Read 5343 times)

vszakats

  • Guest
Hi Pelle,

I've found two possible bugs in version 5 when using AMD64 mode.
Both examples work fine if compiled/linked with version 5 in x86 mode though.

version (everything downloaded from homepage about 2 months ago)
Quote
Pelles ISO C Compiler, Version 5.00.13
Copyright (c) Pelle Orinius 1999-2008

1) Details for '__WSAFDIsSet unresolved':

mktest64.bat
Code: [Select]
set INCLUDE=C:\devl\PellesC-501-64\include;C:\devl\PellesC-501-64\include\win
set LIB=C:\devl\PellesC-501-64\lib;C:\devl\PellesC-501-64\lib\win64

pocc.exe -Ze /Tamd64-coff -c test.c
polink.exe test.obj wsock32.lib ws2_32.lib

test.c
Code: [Select]
#include <winsock2.h>

void main( void )
{
   SOCKET mysocket = 0;
   fd_set set;

   FD_ISSET( mysocket, &set );
}

output
Quote
C:\devl\PellesC-501-64\Bin>pocc.exe -Ze /Tamd64-coff -c test.c

C:\devl\PellesC-501-64\Bin>polink.exe test.obj wsock32.lib ws2_32.lib
POLINK: error: Unresolved external symbol '__WSAFDIsSet'.
POLINK: fatal error: 1 unresolved external(s).

2) Details for 'Internal error: reduce_tree()':

mktest64_2.bat
Code: [Select]
set INCLUDE=C:\devl\PellesC-501-64\include;C:\devl\PellesC-501-64\include\win
set LIB=C:\devl\PellesC-501-64\lib;C:\devl\PellesC-501-64\lib\win64

pocc.exe /Tamd64-coff -c test2.c

test2.c
Code: [Select]
#include <stdio.h>

static long myfunc( void )
{
   char * a = 0;
   char * b = 0;
   size_t c = 0;

   return b - ( a - c );
}

output_2
Quote
C:\devl\PellesC-501-64\Bin>pocc.exe /Tamd64-coff -c test2.c
test2.c(9): fatal error: Internal error: reduce_tree().

Brgds,
Viktor

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: POCC5/AMD64: __WSAFDIsSet unresolved + Internal error: reduce_tree()
« Reply #1 on: September 23, 2008, 05:55:59 PM »
1) Yes, a bug. Can be fixed from the command line:

a) run polib:
> polib -machine:amd64 -makedef:temp ws2_32.lib
(this will create a text file called temp)

b) edit temp, add a second underscore at the beginning of WSAFDIsSet (_WSAFDIsSet --> __WSAFDIsSet), save modified temp.

c) run polib again:
> polib -machine:amd64 -def:temp -out:new_ws2_32.lib
(this will create new_ws2_32.lib which should replace ws2_32.lib -- but make a copy of ws2_32.lib for safety!)

2) I can reproduce it. Maybe I can fix it too.

/Pelle

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: POCC5/AMD64: __WSAFDIsSet unresolved
« Reply #2 on: October 24, 2013, 04:53:54 PM »
__WSAFDIsSet still missing from 64-bit ws2_32.lib.
^^
« Last Edit: October 28, 2013, 11:14:44 AM by timovjl »
May the source be with you