[fpc-pascal] Weird compilation warnings

Guillermo Martínez Jiménez gmartinez at burdjia.com
Wed Feb 29 22:53:46 CET 2012


Hello,

FPC is returning the "Warning: cdecl’ared functions have no high
parameter" but I have no idea why.  The documentation just says
"Functions declared with the cdecl modifier do not pass an extra
implicit parameter." but the affected functions don't have any "extra
implicit parameter".

I'm using FPC 2.4.2 (the one that came with Lazarus).

Here you have some sample code:
___________________________________

UNIT a...;
IMPLEMENTATION

  {$MODE FPC}
  {$PACKRECORDS C}
  {$LONGSTRINGS ON}

{ Next declaration compiles Ok. }
  PROCEDURE al_draw_ustr (CONST font: ALLEGRO_FONTptr; color:
ALLEGRO_COLOR; x, y: SINGLE; flags: LONGINT; CONST ustr:
ALLEGRO_USTRptr); CDECL;

{ Next one raises the "WARNING" }
  FUNCTION al_grab_font_from_bitmap (bmp: ALLEGRO_BITMAPptr; n:
LONGINT; ranges: ARRAY OF LONGINT): ALLEGRO_FONTptr; CDECL;
...

IMPLEMENTATION

  PROCEDURE al_draw_ustr (CONST font: ALLEGRO_FONTptr; color:
ALLEGRO_COLOR; x, y: SINGLE; flags: LONGINT; CONST ustr:
ALLEGRO_USTRptr); CDECL;
  EXTERNAL ALLEGRO_FONT_LIB_NAME;

  FUNCTION al_grab_font_from_bitmap (bmp: ALLEGRO_BITMAPptr; n:
LONGINT; ranges: ARRAY OF LONGINT): ALLEGRO_FONTptr; CDECL;
  EXTERNAL ALLEGRO_FONT_LIB_NAME;
...

END.
_____________________________

Guillermo "Ñuño" Martínez



More information about the fpc-pascal mailing list