taoc3.pp 482 B

123456789101112131415161718192021222324252627282930
  1. { %FAIL }
  2. { second simple array of const test }
  3. { there is no way know how many args
  4. are psuhed for a cdecl'ared araay of const
  5. the compiler should complain here }
  6. {$mode objfpc}
  7. program test_cdecl_array_of_const;
  8. var
  9. l : longint;
  10. const
  11. has_errors : boolean = false;
  12. procedure test(format : pchar; const args : array of const);cdecl;
  13. begin
  14. l:=high(args);
  15. end;
  16. begin
  17. l:=4;
  18. test('dummy',[234]);
  19. if l<>1 then
  20. has_errors:=true;
  21. if has_errors then
  22. halt(1);
  23. end.