Bill Allombert on Thu, 27 Feb 2003 19:15:41 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

#line directives for the pari kernel


Hello pari-dev

Now that the kernel is uild by concatening files, it might be a good
idea to add #line preprocessors directives to have correct error
message from the compiler (and the debugger).

Our main concern was whether it was portable enough.
Since bison use #line without checking the compiler, I believe
It is safe. Anyway, you can test your compiler wth the patch below.

Here a patch for files cat'ed to mp.c files.
Something similar could be done for parilvl?.h  files.

Index: src/kernel/gmp/gcd.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/gmp/gcd.c,v
retrieving revision 1.3
diff -u -r1.3 gcd.c
--- src/kernel/gmp/gcd.c	2003/02/11 18:18:33	1.3
+++ src/kernel/gmp/gcd.c	2003/02/27 17:41:45
@@ -1,3 +1,4 @@
+#line 1 "../src/kernel/gmp/gcd.c"
 /* $Id: gcd.c,v 1.3 2003/02/11 18:18:33 karim Exp $
 
 Copyright (C) 2000  The PARI group.
Index: src/kernel/gmp/mp.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/gmp/mp.c,v
retrieving revision 1.17
diff -u -r1.17 mp.c
--- src/kernel/gmp/mp.c	2003/02/08 18:03:04	1.17
+++ src/kernel/gmp/mp.c	2003/02/27 17:41:45
@@ -1,3 +1,4 @@
+#line 1 "../src/kernel/gmp/mp.c"
 /* $Id: mp.c,v 1.17 2003/02/08 18:03:04 karim Exp $
 
 Copyright (C) 2000  The PARI group.
Index: src/kernel/none/gcd.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/none/gcd.c,v
retrieving revision 1.2
diff -u -r1.2 gcd.c
--- src/kernel/none/gcd.c	2003/02/11 18:18:33	1.2
+++ src/kernel/none/gcd.c	2003/02/27 17:41:45
@@ -1,3 +1,4 @@
+#line 1 "../src/kernel/none/gcd.c"
 /* $Id: gcd.c,v 1.2 2003/02/11 18:18:33 karim Exp $
 
 Copyright (C) 2000  The PARI group.
Index: src/kernel/none/gcdll.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/none/gcdll.c,v
retrieving revision 1.2
diff -u -r1.2 gcdll.c
--- src/kernel/none/gcdll.c	2003/02/11 18:18:33	1.2
+++ src/kernel/none/gcdll.c	2003/02/27 17:41:45
@@ -1,3 +1,4 @@
+#line 1 "../src/kernel/none/gcdll.c"
 /* $Id: gcdll.c,v 1.2 2003/02/11 18:18:33 karim Exp $
 
 Copyright (C) 2000  The PARI group.
Index: src/kernel/none/mp.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/none/mp.c,v
retrieving revision 1.109
diff -u -r1.109 mp.c
--- src/kernel/none/mp.c	2003/02/08 18:03:05	1.109
+++ src/kernel/none/mp.c	2003/02/27 17:41:46
@@ -1,3 +1,4 @@
+#line  1 "../src/kernel/none/mp.c"
 /* $Id: mp.c,v 1.109 2003/02/08 18:03:05 karim Exp $
 
 Copyright (C) 2000  The PARI group.
Index: src/kernel/none/mp_indep.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/none/mp_indep.c,v
retrieving revision 1.5
diff -u -r1.5 mp_indep.c
--- src/kernel/none/mp_indep.c	2003/02/10 18:19:58	1.5
+++ src/kernel/none/mp_indep.c	2003/02/27 17:41:46
@@ -1,3 +1,4 @@
+#line 1 "../src/kernel/none/mp_indep.c"
 /* $Id: mp_indep.c,v 1.5 2003/02/10 18:19:58 cvsadmin Exp $
 
 Copyright (C) 2000  The PARI group.
Index: src/kernel/none/ratlift.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/kernel/none/ratlift.c,v
retrieving revision 1.1
diff -u -r1.1 ratlift.c
--- src/kernel/none/ratlift.c	2003/01/23 13:02:38	1.1
+++ src/kernel/none/ratlift.c	2003/02/27 17:41:46
@@ -1,3 +1,19 @@
+#line 1 "../src/kernel/none/ratlift.c"
+/* $Id:  $
+
+Copyright (C) 2003  The PARI group.
+
+This file is part of the PARI/GP package.
+
+PARI/GP is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation. It is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY WHATSOEVER.
+
+Check the License for details. You should have received a copy of it, along
+with the package; see the file 'COPYING'. If not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
 /*==========================================================
  * ratlift(GEN x, GEN m, GEN *a, GEN *b, GEN amax, GEN bmax)
  *==========================================================


Cheers,
Bill.