[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Few files are missing for socket programming on Windo

From: Michael Matz
Subject: Re: [Tinycc-devel] Few files are missing for socket programming on Windows
Date: Mon, 8 Apr 2019 17:24:23 +0000 (UTC)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)


On Sun, 7 Apr 2019, Christian Jullien wrote:

> Programming with sockets on Windows require:
> - qos.h 
> - winsock2.h
> - ws2ipdef.h

Are qos.h and ws2ipdef.h really headers normally included by user code
or are they included in winsock2.h for some arcane features?  (I have no 
idea about Windows socket programming, so genuine question).  If the 
latter you might do like grischka and comment out some more arcane 
includes of winsock2.h and then would only need to add this one header and 
the .def file.

> And
> - ws2_32.def
> Which are missing from standard tinycc git repository (under win32).
> Ok I've grabbed .h from winapi-full-for-0.9.27 and "./tcc -impdef 
> $(WINDIR)/System32/ws2_32.dll -o lib/ws2_32.def" produced missing .def
> Question, do you allow me to add those files in win32 repository subdir?
> Rationale:
> - socket is an important part of software programming
> - socket is not Windows specific and can be used to make programs compatible 
> between linux and Windows

So the winsock2.h API is roughly equivalent to the POSIX socket API?  
Otherwise this argument is less convincing.

> - ws2_32.def is missing from winapi-full-for-0.9.27
> - winapi-full-for-0.9.27 is BIG as it contains almost all Windows API, so it 
> only useful for those doing Windows specific programming and they'll probably 
> use them all.
> Is it OK for those 4 additional files?

I think it's reasonable to add (but as said above, maybe you can make it 
two files only), but we do need to be careful about feature-creep; 
winapi-full exists for a reason, so we should continue to have tinycc only 
provide basic headers from the target system.  (I would personally go even 
further and remove even the windows specific headers that we have, but I 
do realize that that might be a bit harsh to users that simply want to 
checkout tinycc and see it working).

I would like to know what grischka has to say to this, though, so give it 
a couple days before you include them.


> Btw, I also modified my https://sourceforge.net/projects/wintcc/ which 
> makes standalone and reproducible tcc 32/64 Windows executables 
> bootstrapped with Cygwin. So I'm personally not lost with socket on 
> Windows.
> Christian
> -----Original Message-----
> From: Tinycc-devel [mailto:address@hidden On Behalf Of Michael Matz
> Sent: Sunday, April 07, 2019 04:21
> To: address@hidden
> Subject: Re: [Tinycc-devel] "internal compiler error: vstack leak" and crash 
> with VLA of incomplete type
> Hello Pascal,
> On Sun, 31 Mar 2019, Pascal Cuoq wrote:
> > With TCC from git (commit 9382a3a), the two following inputs vla0.i 
> > and vla1.i each cause the message “error: internal compiler error: vstack 
> > leak”
> > to be printed. In addition, the input vla1.i makes TCC crash:
> > 
> > $ cat vla0.i
> > int X=1;
> > 
> > int main(void) {
> >   int t[][X];
> > }
> Indeed, luckily this use of VLAs is invalid, so we can just diagnose it. 
> The invalid vstack accesses you correctly diagnosed were the result of two 
> paths within TCC disagreeing if the array size for '[]' was pushed or not (it 
> wasn't but the VLA calculation assumed it was).
> Fixed in mob.  Your other report about the nested definition of a union 
> leading to endless recursion is also fixed in mob, FYI.
> Thanks for your reports again.
> Ciao,
> Michael.
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]