Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-12

Warning: cdecl'ared functions have no high parameter

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Judison

Hi all,

I got this warning:

Warning: cdecl'ared functions have no high parameter

on every external C function with overload and a "array of const" parameter

function A(p1: longint; args: array of const): PChar; cdecl; external;
function A(p1: longint): PChar; cdecl; external;

Well, i never used the second variation, but.....

I'm doing something wrong?

I know thar it is you Carl.... You and your annoying warnings... (I'm just kidding, don't flame me) :)

TIA
Your friend,
Judison

Reply by email

Pierre Muller
to Judison
Judison wrote 17 lines
Hi all, I got this warning: Warning: cdecl'ared functions have no high parameter on every external C function with overload and a "array of const" parameter function A(p1: longint; args: array of const): PChar; cdecl; external; function A(p1: longint): PChar; cdecl; external; Well, i never used the second variation, but..... I'm doing something wrong? I know thar it is you Carl.... You and your annoying warnings... (I'm just kidding, don't flame me) :)

You lost:
its me (Pierre Muller) that
added this message.

The purpose of the message is to make clear that the high parameter (containing the nubmer of elements of the array that is normally passed to Free Pascal functions
having an open array parameter, is not passed to that function.

In fact this kind of warnings is only useful if the function is not external... but the warning is issued when 'cdecl' is parsed, so the compiler does not know yet that the function
is external....

I don't know a clear solution....
We could of course change the warning into a hint...

All suggestions welcome.

Reply by email

Florian Klaempfl
to Pierre Muller
Pierre Muller wrote 24 lines
At 06:29 13/12/2002, Judison wrote: >Hi all, > >I got this warning: > >Warning: cdecl'ared functions have no high parameter > >on every external C function with overload and a "array of const" parameter > >function A(p1: longint; args: array of const): PChar; cdecl; external; >function A(p1: longint): PChar; cdecl; external; > >Well, i never used the second variation, but..... > >I'm doing something wrong? > >I know thar it is you Carl.... You and your annoying warnings... >(I'm just kidding, don't flame me) :) You lost: its me (Pierre Muller) that added this message.

But for arrays of constant this doesn't applied, no? We use them to substitute the ... in C.

Show quoted text 15 lines
The purpose of the message is to make clear that the high parameter (containing the nubmer of elements of the array that is normally passed to Free Pascal functions having an open array parameter, is not passed to that function. In fact this kind of warnings is only useful if the function is not external... but the warning is issued when 'cdecl' is parsed, so the compiler does not know yet that the function is external.... I don't know a clear solution.... We could of course change the warning into a hint... All suggestions welcome.

Reply by email

Peter Vreman
to Pierre Muller: You lost: its me (Pierre Muller) that added this message. The purpose of the message is…
Show quoted text 12 lines
>Warning: cdecl'ared functions have no high parameter > >on every external C function with overload and a "array of const" > parameter > >function A(p1: longint; args: array of const): PChar; cdecl; external; In fact this kind of warnings is only useful if the function is not external... but the warning is issued when 'cdecl' is parsed, so the compiler does not know yet that the function is external....

In the 1.1 compiler this is not true anymore. There it is know that the function is external.

Reply by email