bonjour,
my question is : " is it, in GPC, some replacement for Borlnd's {R+ } ( = range check at run time, mainly on arrays indices) ?"
I did not find any trace in the GPC manual. My trial (see below) where unsuccessful and I need it for my students ...
with thanks, sincerly yours,
J.-P. Chevillard Bat 333 universite Paris-Sud 91405 Orsay cedex France
jpchevil@lei.u-psud.fr
********************************************************** * * * please reply also to jacqueline.chevillard@lac.u-psud.fr * * * **********************************************************
===================================
here is the pascal program ::
more inex.pas
program p2; { 2eme exemple }
{$R+}
const Nx = 5; var t : array [1..Nx] of integer; k : integer;
begin
for k:= 1 to Nx do begin t[k] := sqr (k) end ; for k:= -Nx to Nx*2 do begin writeln (k, " ", t[k]) end ; end .
===================================
here the compilation command ::
gpc -v index.pas
===================================
and the output ::
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs gpc version 19991030, based on 2.95.2 20000220 (Debian GNU/Linux) /usr/lib/gcc-lib/i386-linux/2.95.2/gpc-cpp -lang-pascal -v -nocharescape -D__GNU_PASCAL__ -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=19991030 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ index.pas /tmp/ccOyhQfl.i GNU CPP version 2.95.2 20000220 (Debian GNU/Linux) (i386 Linux/ELF) #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/i386-linux/include /usr/lib/gcc-lib/i386-linux/2.95.2/include /usr/include End of search list. index.pas:3: warning: unknown GNU Pascal directive `$r' /usr/lib/gcc-lib/i386-linux/2.95.2/gpc1 /tmp/ccOyhQfl.i -quiet -dumpbase index.pas -version -famtmpfile=/tmp/ccuvcvNf.gpc -o /tmp/ccOyhQfl.s GNU Pascal version 2.95.2 20000220 (Debian GNU/Linux) (i386-linux) compiled by GNU C version 2.95.2 20000220 (Debian GNU/Linux). as -V -Qy -o /tmp/ccOyhQfl1.o /tmp/ccOyhQfl.s GNU assembler version 2.9.5 (i386-linux) using BFD version 2.9.5.0.37 /usr/lib/gcc-lib/i386-linux/2.95.2/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-linux/2.95.2/crtbegin.o -L/usr/lib/gcc-lib/i386-linux/2.95.2 /tmp/ccOyhQfl1.o -lgpc -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-linux/2.95.2/crtend.o /usr/lib/crtn.o
Compilation finished at Wed Aug 29 15:33:08
===================================