Welcome, Guest. Please login or register.

Author Topic: undefined reference to utilitybase or something....and about a few errors...  (Read 953 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Hi Jose,

Quote

Jose wrote:

Oh, and this:

Code: [Select]
printf("Exec Version is %d.%d\n",SysBase->LibNode.lib_Version,SysBase->LibNode.lib_Revision)

gets a warning saying that the string is suspicious :-)


This warning is part of VBCC's format string checking (as the name implies). It's quite strict.

You are using %d in your string, so VBCC checks that the arguments corresponding to this are of type 'int'. If they are not, you get this warning.

Theres a lot of templates, but the most generally used ones are

%d (also %i) : int
%ld (also %li) : long int
%lu : unsigned long int
%h : short int
%hu : unsigned short int
%c : char
%s : char* (C string)
%f : double
%x : hex, lower case - unsigned int
%X : hex, upper case - unsigned int

VBCC compares all the above (and more) with your arguments. The values you are passing are not explicitly "int", therefor it flags a warning that %d is suspicious.
int p; // A