View Issue Details

IDProjectCategoryView StatusLast Update
0000068ascendcompilerpublic2006-05-10 02:22
Reporterjohn 
Assigned Tojohn 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000068: Autogenerated C code fails to compile, problems with btprolog.h ?
DescriptionI can't make any C-compiled models run. Seems to be a problem with btprolog.h, see warning below. Perhaps there is an issue with GCC 3.4.4, or perhaps this is broken?
Additional InformationIn file included from /tmp/ascjohnbt10652_3.c:7:
/usr/lib/btprolog.h:106: error: syntax error before "ExportBinTokenCTable"
/usr/lib/btprolog.h:106: warning: data definition has no type or storage class
/usr/lib/btprolog.h:124: error: syntax error before "cbrt"
/usr/lib/btprolog.h:124: error: conflicting types for 'cbrt'
/usr/lib/btprolog.h:124: error: conflicting types for 'cbrt'
/usr/lib/btprolog.h:124: warning: data definition has no type or storage class
/usr/lib/btprolog.h:126: error: syntax error before "erf"
/usr/lib/btprolog.h:126: error: conflicting types for 'erf'
/usr/lib/btprolog.h:126: error: conflicting types for 'erf'
/usr/lib/btprolog.h:126: warning: data definition has no type or storage class
/usr/lib/btprolog.h:133: error: syntax error before "ascnintF"
/usr/lib/btprolog.h:133: warning: data definition has no type or storage class
/usr/lib/btprolog.h:134: error: syntax error before "dln"
/usr/lib/btprolog.h:134: warning: data definition has no type or storage class
TagsNo tags attached.

Relationships

related to 0000126 closedjohn Switch to libtool / ltdl for dynamic loading 
related to 0000130 closedjohn BinTokenSetOptions should take const char* parameters 
related to 0000129 assignedjohn bintoken BinTokensCreate returns no status code 
related to 0000127 closedjohn Set bintoken.c to write ANSI-C 

Activities

john

2005-11-08 09:04

administrator   ~0000032

This appears to be due to

int EXPORT ...

instead of

int DLEXPORT

in bintoken.c.

JP

john

2005-11-15 04:11

administrator   ~0000040

[john@cruncher2 compiler]$ svn diff bintoken.c bintoken.h
Index: bintoken.c
===================================================================
--- bintoken.c (revision 90)
+++ bintoken.c (working copy)
@@ -1,3 +1,4 @@
+/* ex: set ts=8 : */
 /*
  * bintoken.c
  * By Benjamin A. Allan
@@ -141,11 +142,11 @@
  * They are freed on the next call which specifies a new string or NULL.
  * strings given should not be allocated from tcl.
  */
-int BinTokenSetOptions(char *srcname,
- char *objname,
- char *libname,
- char *buildcommand,
- char *unlinkcommand,
+int BinTokenSetOptions(CONST char *srcname,
+ CONST char *objname,
+ CONST char *libname,
+ CONST char *buildcommand,
+ CONST char *unlinkcommand,
                        unsigned long maxrels,
                        int verbose,
                        int housekeep)
@@ -628,7 +629,7 @@
   /* fixme. win32 has getpid but it is bogus as uniquifier. */
   /* so long as makefile deletes previous dll, windows is ok though */
   sprintf(g_bt_data.regname,"BinTokenArch_%d_%d",++(g_bt_data.nextid),(int)pid);
- FPRINTF(fp,"int EXPORT %s()\n",g_bt_data.regname);
+ FPRINTF(fp,"int DLEXPORT %s()\n",g_bt_data.regname);
   CLINE("{");
   CLINE(" int status;");
   FPRINTF(fp," static struct TableC g_ctable[%lu] =\n",len+1);
@@ -666,6 +667,7 @@
 enum bintoken_error BinTokenCompileC(char *buildcommand)
 {
   int status;
+ FPRINTF(ASCERR,"\nStarting build, command:\n----\n%s\n----\n\n",buildcommand);
   status = system(buildcommand);
   if (status) {
     FPRINTF(ASCERR,"\nBUILD returned %d\n",status);
@@ -823,12 +825,15 @@
         system(cbuf); /* we don't care if the delete fails */
         ascfree(cbuf);
       }
+
+ status = BinTokenLoadC(rellist,libname,g_bt_data.regname);
+ if (status != BTE_ok) {
+ BinTokenErrorMessage(status,root,libname,buildcommand);
+ /* leave source,binary files there to debug */
+ }else{
+ FPRINTF(ASCERR,"BINTOKENLOADC OK\n");
+ }
     }
- status = BinTokenLoadC(rellist,libname,g_bt_data.regname);
- if (status != BTE_ok) {
- BinTokenErrorMessage(status,root,libname,buildcommand);
- /* leave source,binary files there to debug */
- }
     break;
   case BT_F77:
   case BT_SunJAVA:
Index: bintoken.h
===================================================================
--- bintoken.h (revision 90)
+++ bintoken.h (working copy)
@@ -75,11 +75,11 @@
  * of unneeded files; specifically $srcname, objname will be deleted
  * after a successful link.
  */
-extern int BinTokenSetOptions(char *srcname,
- char *objname,
- char *libname,
- char *buildcommand,
- char *unlinkcommand,
+extern int BinTokenSetOptions(CONST char *srcname,
+ CONST char *objname,
+ CONST char *libname,
+ CONST char *buildcommand,
+ CONST char *unlinkcommand,
                               unsigned long maxreln,
                               int verbose,
                               int housekeep);

Issue History

Date Modified Username Field Change
2005-10-08 02:14 john New Issue
2005-11-05 05:34 john Relationship added related to 0000126
2005-11-08 09:04 john Note Added: 0000032
2005-11-15 04:11 john Status new => resolved
2005-11-15 04:11 john Resolution open => fixed
2005-11-15 04:11 john Assigned To => john
2005-11-15 04:11 john Note Added: 0000040
2005-11-15 04:12 john Relationship added related to 0000130
2005-11-15 04:12 john Relationship added related to 0000129
2005-11-15 04:14 john Relationship added related to 0000127
2006-02-07 13:19 john Target release => 1.0
2006-05-10 02:22 john Status resolved => closed