
Index: smixlate.c =================================================================== --- smixlate.c (revision 7960) +++ smixlate.c (working copy) @@ -69,7 +69,8 @@
static void process(FILE *stream) { - int c, space = 0; + char c; + int space = 0; enum { TXT, NUM, NUMDOT, NUMDOTNUM, OID, OIDDOT, EATSPACE } state = TXT; dstring_t *token, *subst;
Regards Anders

On Thu, Mar 27, 2008 at 09:43:08AM +0100, Anders Broman wrote:
Index: smixlate.c
--- smixlate.c (revision 7960) +++ smixlate.c (working copy) @@ -69,7 +69,8 @@
static void process(FILE *stream) {
- int c, space = 0;
- char c;
enum { TXT, NUM, NUMDOT, NUMDOTNUM, OID, OIDDOT, EATSPACE } state =int space = 0;
TXT; dstring_t *token, *subst;
Regards Anders
Which warning is this supposed to fix?
Note that fgetc() and isascii() and friends actually do return/accpet an int and changing the int to a char might not be the right thing on all platforms...
My gcc (GCC) 4.1.2 -Wall does actually not generate warnings on smixlate.c.
/js

-----Original Message----- From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de] Sent: den 27 mars 2008 10:38 To: Anders Broman Cc: libsmi@ibr.cs.tu-bs.de Subject: Re: [libsmi] Get rid of Warnings in smixlate.c
On Thu, Mar 27, 2008 at 09:43:08AM +0100, Anders Broman wrote:
Index: smixlate.c
--- smixlate.c (revision 7960) +++ smixlate.c (working copy) @@ -69,7 +69,8 @@
static void process(FILE *stream) {
- int c, space = 0;
- char c;
enum { TXT, NUM, NUMDOT, NUMDOTNUM, OID, OIDDOT, EATSPACE } stateint space = 0;
= TXT; dstring_t *token, *subst;
Regards Anders
Which warning is this supposed to fix?
Note that fgetc() and isascii() and friends actually do return/accpet
an int and changing the int to a char might not be the right thing on all
platforms...
My gcc (GCC) 4.1.2 -Wall does actually not generate warnings on
smixlate.c.
/js
The following warnings:
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D _WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I.. .\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ . ..\tools\smixlate.c smixlate.c ...\tools\smixlate.c(101) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(110) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(112) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(115) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(121) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(124) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(130) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(132) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(135) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(141) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(143) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(171) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(204) : warning C4761: integral size mismatch in argument; conversion supplied ...\tools\smixlate.c(229) : warning C4761: integral size mismatch in argument; conversion supplied cl -D_CRT_SECURE_NO_DEPRECATE=1 /osmixlate.exe .\smixlate.obj .\dstring.obj smi.lib Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
/Anders

On Thu, Mar 27, 2008 at 11:45:40AM +0100, Anders Broman wrote:
The following warnings:
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
-D_X86_=1 -D _WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I.. .\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ . ..\tools\smixlate.c smixlate.c ...\tools\smixlate.c(101) : warning C4761: integral size mismatch in argument; conversion supplied
[...]
I have thrown in explicit casts to (char) for the function calls dstring_append_char(). This should make the compiler happy without changing any code semantics.
/js

Hi, Thanks the number of warnings decreased the out put now looks like: parser-sming.c parser-sming.y(317) : warning C4244: '=' : conversion from 'unsigned __int64 ' to 'int ', possible loss of data parser-sming.y(2168) : warning C4047: 'function' : 'struct List *' differs in levels of indirection from 'int ' parser-sming.y(2168) : warning C4024: 'setAttributeList' : different types for formal and actual parameter 2 parser-sming.y(2169) : warning C4047: '=' : 'struct List *' differs in levels of indirection from 'int ' parser-sming.y(1963) : warning C4101: 'p' : unreferenced local variable parser-sming.y(2129) : warning C4101: 'p' : unreferenced local variable cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -D_Win32 -D__STDC__ -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\lib\scanner-sming.c scanner-sming.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\lib\snprintf.c snprintf.c ...\lib\snprintf.c(363) : warning C4761: integral size mismatch in argument; conversion supplied ...\lib\snprintf.c(180) : warning C4761: integral size mismatch in argument; conversion supplied lib /out:smi.lib .\win.obj .\shhopt.obj .\data.obj .\check.obj .\error.obj .\util.obj .\smi.obj .\parser-smi.obj .\scanner-smi.obj .\parser-sming.obj .\scanner-sming.obj .\snprintf.obj Microsoft (R) Library Manager Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\smiquery.c smiquery.c cl -D_CRT_SECURE_NO_DEPRECATE=1 /osmiquery.exe .\smiquery.obj smi.lib Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:smiquery.exe /out:smiquery.exe .\smiquery.obj smi.lib cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\smilint.c smilint.c cl -D_CRT_SECURE_NO_DEPRECATE=1 /osmilint.exe .\smilint.obj smi.lib Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:smilint.exe /out:smilint.exe .\smilint.obj smi.lib cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\smixlate.c smixlate.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dstring.c dstring.c ...\tools\dstring.c(150) : warning C4013: 'vsnprintf' undefined; assuming extern returning int ...\tools\dstring.c(152) : warning C4018: '<=' : signed/unsigned mismatch ...\tools\dstring.c(153) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dstring.c(191) : warning C4018: '<=' : signed/unsigned mismatch ...\tools\dstring.c(192) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dstring.c(210) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dstring.c(219) : warning C4018: '>' : signed/unsigned mismatch cl -D_CRT_SECURE_NO_DEPRECATE=1 /osmixlate.exe .\smixlate.obj .\dstring.obj smi.lib Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:smixlate.exe /out:smixlate.exe .\smixlate.obj .\dstring.obj smi.lib cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\smidump.c smidump.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-sming.c dump-sming.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-smi.c dump-smi.c ...\tools\dump-smi.c(1541) : warning C4018: '>' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-imports.c dump-imports.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-types.c dump-types.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-tree.c dump-tree.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-mosy.c dump-mosy.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-corba.c dump-corba.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-netsnmp.c dump-netsnmp.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-jax.c dump-jax.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-xml.c dump-xml.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-cm.c dump-cm.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-metrics.c dump-metrics.c ...\tools\dump-metrics.c(442) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(471) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(474) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(529) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(532) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(587) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(590) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(644) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(699) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-metrics.c(702) : warning C4018: '<' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-identifiers.c dump-identifiers.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-python.c dump-python.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-perl.c dump-perl.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-scli.c dump-scli.c ...\tools\dump-scli.c(697) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-scli.c(1239) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-scli.c(1434) : warning C4018: '<' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-xsd.c dump-xsd.c ...\tools\dump-xsd.c(1019) : warning C4018: '<' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-sppi.c dump-sppi.c ...\tools\dump-sppi.c(1306) : warning C4018: '>' : signed/unsigned mismatch ...\tools\dump-sppi.c(1564) : warning C4018: '>' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-sizes.c dump-sizes.c ...\tools\dump-sizes.c(155) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-sizes.c(247) : warning C4018: '<' : signed/unsigned mismatch ...\tools\dump-sizes.c(317) : warning C4018: '<' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-svg.c dump-svg.c ...\tools\dump-svg.c(253) : warning C4101: 'i' : unreferenced local variable ...\tools\dump-svg.c(755) : warning C4244: 'initializing' : conversion from 'double ' to 'const float ', possible loss of data ...\tools\dump-svg.c(759) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(760) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(776) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(779) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(792) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(795) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(801) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(802) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(816) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(819) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(830) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(833) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(1679) : warning C4101: 'lastElem' : unreferenced local variable ...\tools\dump-svg.c(1827) : warning C4101: 'lastElem' : unreferenced local variable ...\tools\dump-svg.c(2702) : warning C4244: '=' : conversion from 'int ' to 'float ', possible loss of data ...\tools\dump-svg.c(2859) : warning C4244: '-=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(2861) : warning C4244: '-=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(2863) : warning C4244: '+=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(2906) : warning C4305: '*=' : truncation from 'const double ' to 'float ' ...\tools\dump-svg.c(2981) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data ...\tools\dump-svg.c(3143) : warning C4101: 'tComponent' : unreferenced local variable ...\tools\dump-svg.c(3144) : warning C4101: 'group' : unreferenced local variable ...\tools\dump-svg.c(3141) : warning C4101: 'tNode' : unreferenced local variable ...\tools\dump-svg.c(3142) : warning C4101: 'tEdge' : unreferenced local variable cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-compliance.c dump-compliance.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-boilerplate.c dump-boilerplate.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\dump-yang.c dump-yang.c ...\tools\dump-yang.c(550) : warning C4018: '>' : signed/unsigned mismatch ...\tools\dump-yang.c(587) : warning C4018: '>' : signed/unsigned mismatch ...\tools\dump-yang.c(598) : warning C4129: '{' : unrecognized character escape sequence cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\fprint.c fprint.c ...\tools\fprint.c(52) : warning C4013: 'smiVasprintf' undefined; assuming extern returning int ...\tools\fprint.c(77) : warning C4018: '>' : signed/unsigned mismatch cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\rea.c rea.c cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\fortopat.c fortopat.c ...\tools\fortopat.c(307) : warning C4018: '<' : signed/unsigned mismatch ...\tools\fortopat.c(327) : warning C4018: '<' : signed/unsigned mismatch cl -D_CRT_SECURE_NO_DEPRECATE=1 /osmidump.exe .\smidump.obj .\dump-sming.obj .\dump-smi.obj .\dump-imports.obj .\dump-types.obj .\dump-tree.obj .\dump-mosy.obj .\dump-corba.obj .\dump-netsnmp.obj .\dump-jax.obj .\dump-xml.obj .\dump-cm.obj .\dump-metrics.obj .\dump-identifiers.obj .\dump-python.obj .\dump-perl.obj .\dump-scli.obj .\dump-xsd.obj .\dump-sppi.obj .\dump-sizes.obj .\dump-svg.obj .\dump-compliance.obj .\dump-boilerplate.obj .\dump-yang.obj .\fprint.obj .\rea.obj .\fortopat.obj smi.lib Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:smidump.exe /out:smidump.exe .\smidump.obj .\dump-sming.obj .\dump-smi.obj .\dump-imports.obj .\dump-types.obj .\dump-tree.obj .\dump-mosy.obj .\dump-corba.obj .\dump-netsnmp.obj .\dump-jax.obj .\dump-xml.obj .\dump-cm.obj .\dump-metrics.obj .\dump-identifiers.obj .\dump-python.obj .\dump-perl.obj .\dump-scli.obj .\dump-xsd.obj .\dump-sppi.obj .\dump-sizes.obj .\dump-svg.obj .\dump-compliance.obj .\dump-boilerplate.obj .\dump-yang.obj .\fprint.obj .\rea.obj .\fortopat.obj smi.lib cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I...\win -IC:\PROGRA~1\MICROS~2\VC98\include -D_CRT_SECURE_NO_DEPRECATE=1 -Fo.\ ...\tools\smidiff.c smidiff.c ...\tools\smidiff.c(874) : warning C4018: '<' : signed/unsigned mismatch ...\tools\smidiff.c(1810) : warning C4018: '<' : signed/unsigned mismatch ...\tools\smidiff.c(1849) : warning C4018: '<' : signed/unsigned mismatch cl -D_CRT_SECURE_NO_DEPRECATE=1 /osmidiff.exe .\smidiff.obj smi.lib Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:smidiff.exe /out:smidiff.exe .\smidiff.obj smi.lib
Regards Anders
-----Original Message----- From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de] Sent: den 27 mars 2008 22:17 To: Anders Broman Cc: libsmi@ibr.cs.tu-bs.de Subject: Re: [libsmi] Get rid of Warnings in smixlate.c
On Thu, Mar 27, 2008 at 11:45:40AM +0100, Anders Broman wrote:
The following warnings:
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -Z7 -Od -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
-D_X86_=1 -D _WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -I...\lib -I.. .\win -IC:\PROGRA~1\MICROS~2\VC98\include
-D_CRT_SECURE_NO_DEPRECATE=1
-Fo.\ . ..\tools\smixlate.c smixlate.c ...\tools\smixlate.c(101) : warning C4761: integral size mismatch in argument; conversion supplied
[...]
I have thrown in explicit casts to (char) for the function calls dstring_append_char(). This should make the compiler happy without changing any code semantics.
/js

Anders Broman wrote:
Index: smixlate.c
--- smixlate.c (revision 7960) +++ smixlate.c (working copy) @@ -69,7 +69,8 @@
static void process(FILE *stream) {
- int c, space = 0;
- char c;
enum { TXT, NUM, NUMDOT, NUMDOTNUM, OID, OIDDOT, EATSPACE } state =int space = 0;
TXT; dstring_t *token, *subst;
What compiler is that? As Juergen says gcc/glibc requires it to be int.
Solaris might require it to be unsigned char.
participants (3)
-
Anders Broman
-
Andrew Hood
-
Juergen Schoenwaelder