tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] problems with assert.h


From: Luis Alejandro Muzzachiodi
Subject: [Tinycc-devel] problems with assert.h
Date: Tue, 23 Nov 2010 21:15:46 -0800 (PST)

Compiling with 23/11/2010's TCC version this line

             assert ( strcmp ( opt->optName, "-onApply" ) == 0 );

causes tcc show me this

assistant.c:188: warning: pasting "L" and ""strcmp ( opt->optName, \"-onApply\"
) == 0"" does not give a valid preprocessing token

this error is repetead with others lines with asserts (but showing wrongs line's numbers and several times for each line) and finally seem as TCC enters in some kind of loop and shows

assistant.c:263: warning: Ignoring unknown preprocessing directive #

and stay there until a CTRL+C.
So, testing a minimal version i found some problems related to assert.h
Let the "prueba.c" code:

/*** comment 1 ***
#include <string.h>
#include <assert.h>
*/
#define NDEBUG

void main() {
char* uno="b";
    assert ( strcmp (uno, "a" ) == 0 );
    return 0;    
}

-----------------------------------------------------------------------
Result :

Without comment 1, don't compile, shows:
«prueba.c:8: error: missing terminating " character»
Now, taking off, the NDEBUG's define then compile ok.
---------------------------------------------------------    
With comment1: compile ok, shows:
«Assertion failed: (null), file b, line 1310656

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.»
---------------------------------------------------------
Marginal note: including assert.h use _wassert that's msvcrt version 8,
(this could cause problems with old XP - msvcrt 7).

Alejandro

 
reply via email to

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