tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] GNUmake v4.4 port on Windows with tcc


From: Christian Jullien
Subject: Re: [Tinycc-devel] GNUmake v4.4 port on Windows with tcc
Date: Thu, 3 Nov 2022 15:29:47 +0100

Of course it does.
I considered this solution but I was reluctant to ask you to change the
source because tcc currently lacks C99 strto[u]ll
That's why I moved the patch to build_w32.bat script
I let you decide what is the best for GNUmake. Both patches work equally
well

As side note, compiling GNUmake with cl x64 gives the following warnings

- Compiling src/ar.c
ar.c
- Compiling src/arscan.c
arscan.c
- Compiling src/commands.c
commands.c
- Compiling src/default.c
default.c
- Compiling src/dir.c
dir.c
- Compiling src/expand.c
expand.c
- Compiling src/file.c
file.c
- Compiling src/function.c
function.c
src/function.c(1959): warning C4267: 'function': conversion from 'size_t' to
'unsigned int', possible loss of data
- Compiling src/getopt.c
getopt.c
- Compiling src/getopt1.c
getopt1.c
- Compiling src/guile.c
guile.c
- Compiling src/hash.c
hash.c
- Compiling src/implicit.c
implicit.c
- Compiling src/job.c
job.c
F:\wintcc\make-4.4\src\job.c(898) : warning C4701: potentially uninitialized
local variable 'exit_sig' used
F:\wintcc\make-4.4\src\job.c(993) : warning C4701: potentially uninitialized
local variable 'coredump' used
F:\wintcc\make-4.4\src\job.c(898) : warning C4701: potentially uninitialized
local variable 'exit_code' used
- Compiling src/load.c
load.c
- Compiling src/loadapi.c
loadapi.c
- Compiling src/main.c
main.c
- Compiling src/misc.c
misc.c
src/misc.c(431): warning C4267: 'function': conversion from 'size_t' to
'unsigned int', possible loss of data
src/misc.c(453): warning C4267: 'function': conversion from 'size_t' to
'unsigned int', possible loss of data
src/misc.c(737): warning C4101: 'err': unreferenced local variable
F:\wintcc\make-4.4\src\misc.c(594) : warning C4706: assignment within
conditional expression
- Compiling src/output.c
output.c
- Compiling src/read.c
read.c
F:\wintcc\make-4.4\src\read.c(2134) : warning C4701: potentially
uninitialized local variable 'cmds' used
F:\wintcc\make-4.4\src\read.c(2134) : warning C4703: potentially
uninitialized local pointer variable 'cmds' used
- Compiling src/remake.c
remake.c
- Compiling src/remote-stub.c
remote-stub.c
- Compiling src/rule.c
rule.c
- Compiling src/shuffle.c
shuffle.c
- Compiling src/signame.c
signame.c
- Compiling src/strcache.c
strcache.c
- Compiling src/variable.c
variable.c
F:\wintcc\make-4.4\src\variable.c(1810) : warning C4701: potentially
uninitialized local variable 'origin' used
F:\wintcc\make-4.4\src\variable.c(1810) : warning C4703: potentially
uninitialized local pointer variable 'origin' used
- Compiling src/version.c
version.c
- Compiling src/vpath.c
vpath.c
- Compiling src/w32/pathstuff.c
pathstuff.c
- Compiling src/w32/w32os.c
w32os.c
- Compiling src/w32/compat/posixfcn.c
posixfcn.c
- Compiling src/w32/subproc/misc.c
misc.c
- Compiling src/w32/subproc/sub_proc.c
sub_proc.c


-----Original Message-----
From: Eli Zaretskii [mailto:eliz@gnu.org] 
Sent: Thursday, November 03, 2022 14:50
To: jullien@eligis.com; psmith@gnu.org
Cc: make-w32@gnu.org; tinycc-devel@nongnu.org
Subject: Re: GNUmake v4.4 port on Windows with tcc

> From: Paul Smith <psmith@gnu.org>
> Cc: tinycc-devel@nongnu.org, 'Eli Zaretskii' <eliz@gnu.org>
> Date: Wed, 02 Nov 2022 11:50:45 -0400
> 
> On Wed, 2022-11-02 at 16:40 +0100, Christian Jullien wrote:
> > It appears that tcc on Windows lacks strtoll and strtoull (something
> > that
> > needs to be fixed on tcc side of course).
> > Meanwhile, it can easily be patched in build_w32.bat by adding
> > -Dstrtoull=_strtoui64 -Dstrtoll=_strtoi64 at line 330
> > 
> > call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -
> > I./src
> > -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -
> > Dstrtoull=_strtoui64
> > -Dstrtoll=_strtoi64 -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o
> > %OUTDIR%/%1.%O%
> > -c %1.c
> > 
> > Hope it helps.
> 
> Thanks for that note.  We will choose a different way to address this I
> expect but it's good to know there's a problem.

Christian, does the below fix the problem?

--- src/config.h.W32~0  2022-10-23 17:52:32.000000000 +0300
+++ src/config.h.W32    2022-11-03 15:47:14.468500000 +0200
@@ -343,6 +343,10 @@ this program.  If not, see <https://www.
 /* #undef HAVE_STRSIGNAL */
 
 /* Define to 1 if you have the `strtoll' function. */
+#ifdef __TINYC__
+#define strtoll _strtoi64
+#define strtoull _strtoui64
+#endif
 #define HAVE_STRTOLL 1
 
 /* Define to 1 if `d_type' is a member of `struct dirent'. */




reply via email to

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