From e4e144bb8304ed259d333a1c0f4460b0e70e7387 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 7 Oct 2008 23:34:32 +0000 Subject: [PATCH] 2008-10-08 01:31 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/compiler/gencc.c * Trick to avoid MSVC -W4 warnings in -gc3 compiled C code, when compiled string literal contained certain high (> 127) chars followed by a digit. Thanks Przemek. NOTE: I've checked and hexadecimal format has even more such problems. --- harbour/ChangeLog | 8 ++++++++ harbour/source/compiler/gencc.c | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b5ccd7c307..e3cd1a6896 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-08 01:31 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * source/compiler/gencc.c + * Trick to avoid MSVC -W4 warnings in -gc3 compiled C code, + when compiled string literal contained certain high (> 127) + chars followed by a digit. Thanks Przemek. + NOTE: I've checked and hexadecimal format has even more + such problems. + 2008-10-07 21:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/runner.c * harbour/source/vm/codebloc.c diff --git a/harbour/source/compiler/gencc.c b/harbour/source/compiler/gencc.c index 0479268f25..483ef5ff97 100644 --- a/harbour/source/compiler/gencc.c +++ b/harbour/source/compiler/gencc.c @@ -66,7 +66,9 @@ void hb_compGenCString( FILE * yyc, BYTE * pText, ULONG ulLen ) if( uchr == '"' || uchr == '\\' || uchr == '?' ) fprintf( yyc, "\\%c", uchr ); else if( uchr < ( BYTE ) ' ' || uchr >= 127 ) - fprintf( yyc, "\\%03o", uchr ); + fprintf( yyc, "\\%03o%s", uchr, ulPos < ulLen - 1 && + pText[ ulPos + 1 ] >= ( BYTE ) '0' && + pText[ ulPos + 1 ] <= ( BYTE ) '9' ? "\" \"" : "" ); else fprintf( yyc, "%c", uchr ); }