tw2046.pp 597 B

1234567891011121314151617181920212223242526272829303132333435
  1. { %skiptarget=go32v2 }
  2. { Source provided for Free Pascal Bug Report 2046 }
  3. { Submitted by "Mattias Gaertner" on 2002-07-17 }
  4. { e-mail: [email protected] }
  5. program printftest;
  6. {$mode objfpc}{$H+}
  7. const
  8. {$ifdef win32}
  9. libc='msvcrt';
  10. {$else}
  11. libc='c';
  12. {$endif}
  13. procedure sprintf(a, fm: pchar; args: array of const); cdecl; external libc;
  14. procedure print(args: array of const);
  15. var
  16. a : array[0..255] of char;
  17. begin
  18. sprintf(a,'a number %i',args);
  19. writeln(a);
  20. if a<>'a number 3333' then
  21. begin
  22. writeln('Error!');
  23. halt(1);
  24. end;
  25. end;
  26. begin
  27. print([3333]);
  28. end.