[Tinycc-devel] for loop not handling function return value dereferencing

2010-09-13 Thread Timo Sirainen
I noticed it with code: for (errno = 0;;) {} But since errno is a macro, it's clearer as: int *foo(void) {return 0;} int main(void) { for (*foo() = 1;;) ; } This fails with: test.c:4: error: identifier expected ___ Tinycc-devel mailing lis

Re: [Tinycc-devel] Hi Is there a winbase.h available for TinyCC that includes function ReplaceFile ?

2010-08-25 Thread Timo Lähde
Hello Ed! tcc.exe can compile this: #define _WIN32_WINNT 0x0500 #define WIN32_LEAN_AND_MEAN #include //WINBASEAPI WINBOOL WINAPI ReplaceFileA(LPCSTR lpReplacedFileName,LPCSTR lpReplacementFileName,LPCSTR lpBackupFileName,DWORD dwReplac

Re: [Tinycc-devel] tcc version 0.9.25 under Windows XP: "-static"doesn't work at all

2010-08-13 Thread Timo VJ Lähde
Without -static switch tcc.exe use msvcrt.def and kernel32.def for linking. With -static switch tcc.exe search libmsvcrt.a and libkernel32.a for linking and those doesn't exist at all. Example for own lib: tcc.exe -c foo-lib.c tiny_libmaker libfoo.a foo-lib.o tcc1 foo-test.c -lfoo -L. ---

Re: [Tinycc-devel] Trying to compile c program that writes registry key then starts a .cmd file with createprocess (that is it). Compiles fine with PellesC.

2010-08-08 Thread Timo Lähde
run tiny_impdef.exe advapi32.dll copy advapi32.def file to folder lib tcc.exe example.c -ladvapi32 2010/8/9 ED GROSSHEIM : > Hi, > When I compile with tcc, I get the errors: > > ::tcc: undefined symbol '_regopenkey...@20' > ::tcc: undefined symbol '_regclose...@4' > ::tcc: undefined symbol '_regc

Re: [Tinycc-devel] License of tiny_libmaker in Tiny CC

2010-07-30 Thread Timo Lähde
Hello! Yes it should be. License is same as the rest of the files under LGPLv2. -- Timo VJ Lähde 2010/7/30 Thomas Preud'homme : > Greetings Timovj Lähde, > > I'm the current debian maintainer of tiny CC and found while updating > copyright information within the tcc

Re: [Tinycc-devel] [Fwd: bug in tcc wi32]

2010-05-02 Thread Timo Lähde
fix. > > (Beware, not as suggested below ;)) > > --- grischka > > Timo VJ Lähde wrote: >> >> Maybe check first previous char if possible but using negative pointer >> isn't safe: >> tccpp.c line 2281 >>   case '.': >>       /* chec

Re: [Tinycc-devel] [Fwd: bug in tcc wi32]

2010-04-29 Thread Timo VJ Lähde
Maybe check first previous char if possible but using negative pointer isn't safe: tccpp.c line 2281 case '.': /* check first for a local label (.Lxx:) */ if (p[1] == 'L' && (p[-1] == '\n' || p[-1] == '\t' || p[-1] == ' ')) { /* fast case */ goto parse_ide

[Tinycc-devel] latest mob Makefile and LIBS=.

2010-04-27 Thread Timo Lähde
Why there is '.' at end in 'LIBS=.' in Makefile line 12 ? With MSys / MinGW i can't compile tcc.exe's without removing it. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Re: [Tinycc-devel] Re: Cleaning mob [Was Several patchs from Debianpackaging]

2010-04-21 Thread Timo VJ Lähde
What is the best way to keep local mob up to date ? What git commands i should give ? What config settings are usable ? --Timppa - Original Message - From: "grischka" To: Cc: Sent: Wednesday, April 21, 2010 10:42 AM Subject: [Tinycc-devel] Re: Cleaning mob [Was Several patchs from

[Tinycc-devel] PE log file per file

2010-04-21 Thread Timo VJ Lähde
I prefer PE log file per file: --- a\tccpe.c Mon Apr 19 15:34:58 2010 +++ b\tccpe.c Wed Apr 21 09:18:53 2010 @@ -1882,7 +1886,10 @@ } #ifdef PE_PRINT_SECTIONS -pe_print_sections(s1, "tcc.log"); +char logfile[260]; +strcpy(logfile, filename); +strcat(logfile, ".log"); +pe_

[Tinycc-devel] ARM PE CeGCC compability

2010-04-20 Thread Timo Lähde
If we want some CeGCC compability. To libtc.c: #if defined TCC_TARGET_PE && defined(TCC_TARGET_ARM) tcc_define_symbol(s, "ARM", NULL); tcc_define_symbol(s, "_M_ARM", NULL); tcc_define_symbol(s, "UNDER_CE", NULL); tcc_define_symbol(s, "UNICODE", NULL); tcc_define_symbol(s, "_UN

Re: [Tinycc-devel] arm-pe-tcc crosscompiler

2010-04-20 Thread Timo VJ Lähde
This patch correct library names for arm wince: - --- a\tccpe.c Mon Apr 19 15:34:58 2010 +++ b\tccpe.c Tue Apr 20 14:42:57 2010 @@ -1770,7 +1770,11 @@ if (0 == s1->nostdlib) { static const char *libs[] = { +#ifdef TCC

Re: [Tinycc-devel] arm-pe-tcc crosscompiler

2010-04-20 Thread Timo VJ Lähde
I don't really know which version of windows mobile I've dumped some time ago (coredll.dll, file size:615424). May be helpful. AFAIK, older winmobile versions doesn't provide named exports, thus applications imports those by ordinals. GreetZ. 2010/4/19 Timo VJ Lähde : With latest

[Tinycc-devel] arm-pe-tcc crosscompiler

2010-04-19 Thread Timo VJ Lähde
With latest mob you can try this in win32: gcc -Os -fno-strict-aliasing ../tcc.c -o arm-pe-tcc.exe -s -DTCC_TARGET_ARM arm-pe-tcc.exe -nostdlib MsgBoxCE.c -lcoredll -- // MsgBoxCE.c void _start(void) { MessageBoxW(0, "T\0e\0s\0t\0A\0R\0M\0\0",

[Tinycc-devel] WinCE ARM prolog

2010-04-16 Thread Timo VJ Lähde
Is TinyCC ARM prolog : mov ip, sp stmdb sp!, {fp, ip, lr} add fp, sp, #C compatible with this ? From Microsoft http://msdn.microsoft.com/en-us/library/ms254231.aspx The following examples show how to construct several ARM prologs. ARM Prolog with frame in R11. MOVr12, r13; Save st

Re: [Tinycc-devel] WinCE ARM code

2010-04-16 Thread Timo VJ Lähde
From: "Daniel Glöckner" To: Sent: Friday, April 16, 2010 4:02 AM Subject: Re: [Tinycc-devel] WinCE ARM code On Thu, Apr 15, 2010 at 06:21:10PM +0300, Timo VJ Lähde wrote: Is that correct code ? [00011038] 204825FF strcsdr2, [r8], #-5F [0001103C] 0001 andeq

[Tinycc-devel] WinCE ARM code

2010-04-15 Thread Timo VJ Lähde
tcc compiled with TCC_TARGET_ARM and TCC_TARGET_PE tcc MsgBox.c -nostdlib -lcoredll /* MsgBox.c */ void _start(void) { MessageBoxW(0, "T\0e\0s\0t\0", "T\0e\0s\0t\0", 0); } ---

[Tinycc-devel] In WinCE ARM should be pe.subsystem = 9;

2010-04-13 Thread Timo VJ Lähde
Is that correct ? tccpe.c 1824: #if defined(TCC_TARGET_ARM) pe.subsystem = 3; #else pe.subsystem = 9; #endif In WinCE ARM should be pe.subsystem = 9; ? --Timppa ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lis

Re: [Tinycc-devel] Addresses of variables

2010-04-11 Thread Timo
u think is a bug? If you think, that it is a bug to allocate variable 'first' in a higher address than the variable 'second', you are wrong. Compiler is free to allocate variables as it wishes. Actually it would have been free *not* to allocate them a

[Tinycc-devel] win32: ftime() and WindowsXP

2010-04-09 Thread Timo VJ Lähde
If i compile tcc.exe with tcc.exe, i can't run it in WindowsXP because of missing function in msvcrt.dll : ftime32(). --Timppa ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel

[Tinycc-devel] Win32: PE subsystem patch proposal

2010-04-08 Thread Timo VJ Lähde
Is this usable Win32: PE subsystem patch: - if _winstart found pe_type = PE_GUI; - if linker option subsystem is set use it. Example -Wl,subsystem,gui What else should check ? --- --- a\tccpe.c Tue Apr 06

Re: [Tinycc-devel] Re: Before TinyCC supports __declspec(noreturn)and __attribute__ ((__nothrow__))

2010-04-06 Thread Timo VJ Lähde
- Original Message - From: "grischka" To: Sent: Friday, April 02, 2010 12:46 PM Subject: Re: [Tinycc-devel] Re: Before TinyCC supports __declspec(noreturn)and __attribute__ ((__nothrow__)) Timo VJ Lähde wrote: That first setjmp.h patch is not needed id this patch

[Tinycc-devel] tccpp.c more portable string

2010-04-06 Thread Timo VJ Lähde
Is this more portable string ? --- a\tccpp.c Tue Apr 06 00:33:14 2010 +++ b\tccpp.c Tue Apr 06 11:33:05 2010 @@ -70,8 +70,8 @@ /* WARNING: the content of this string encodes token numbers */ static const unsigned char tok_two_chars[] = -"<=\236>=\235!=\225&&\240||\241++\244--\242==\224<<\1>>

Re: [Tinycc-devel] Win32: TinyC subsystem GUI

2010-04-02 Thread Timo VJ Lähde
No, but it makes possible to use _winstart as entrypoint directly without runtime library. - Original Message - From: "grischka" To: Sent: Friday, April 02, 2010 12:43 PM Subject: Re: [Tinycc-devel] Win32: TinyC subsystem GUI Timo VJ Lähde wrote: If i compile test-

[Tinycc-devel] Win32: TinyC subsystem GUI

2010-04-01 Thread Timo VJ Lähde
If i compile test-gui.c with this commandline: tcc.exe test-gui.c -nostdlib -Wl,--subsystem,gui test-gui.exe is still commandline program PE_EXE and it does not follow pe.subsystem value that should be 2 PE_GUI and should use _winstart startpoint. --- test-gui.c --- int _winstart(void) { return

[Tinycc-devel] Re: Before TinyCC supports __declspec(noreturn) and __attribute__ ((__nothrow__))

2010-03-31 Thread Timo VJ Lähde
That first setjmp.h patch is not needed id this patch is already used: -- --- a\tccgen.c Mon Mar 15 23:51:00 2010 +++ b\tccgen.c Thu Apr 01 08:22:38 2010 @@ -2900,7 +2900,7 @@ case TOK_ATTRIBUTE1: case TOK_ATTRIBUTE2:

[Tinycc-devel] mob: error: too many basic types

2010-03-31 Thread Timo VJ Lähde
Latest MOB: With this patch i can past this error: /win32/include/winapi/winnt.h:3103: error: too many basic types -- --- a\tccgen.c Mon Mar 15 23:51:00 2010 +++ b\tccgen.c Thu Apr 01 08:22:38 2010 @@ -2900,7 +2900,7 @@ case TOK_A

[Tinycc-devel] win32: tiny_libmaker leaves temporary files on error

2010-03-31 Thread Timo VJ Lähde
win32/tools/tiny_libmaker leaves temporary files on error - --- a/tiny_libmaker.c Mon Mar 15 23:51:00 2010 +++ b/tiny_libmaker.c Wed Mar 31 22:35:06 2010 @@ -99,6 +99,7 @@ if ((fh = fopen(afile, "wb")) == NULL) { fpr

[Tinycc-devel] Before TinyCC supports __declspec(noreturn) and __attribute__ ((__nothrow__))

2010-03-31 Thread Timo VJ Lähde
Latest mob and win32 have problems with those __attribute etc: - Before TinyCC supports __declspec(noreturn) and __attribute__ ((__nothrow__)) This patch don't help /win32/include/winapi/winnt.h:3103: error: too many basic types. -

[Tinycc-devel] Win32: without ar.exe it is still possible to create tcc.exe

2010-03-31 Thread Timo VJ Lähde
win32 - Without ar.exe it is still possible to create tcc.exe. Perhaps libtcc.a should be created with tcc for later tcc usage. - --- a\build-tcc.bat Thu Jan 14 21:00:04 2010 +++