Changeset 6e4b913


Ignore:
Timestamp:
Jul 10, 2016, 4:35:32 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
4e06c1e, c13d970
Parents:
07bc165
Message:

allow 32-bit compilation of cfa-cpp, and 32-bit compilation of CFA programs (including CFA libraries)

Files:
23 edited

Legend:

Unmodified
Added
Removed
  • Makefile.in

    r07bc165 r6e4b913  
    127127CFA_BACKEND_CC = @CFA_BACKEND_CC@
    128128CFA_BINDIR = @CFA_BINDIR@
     129CFA_FLAGS = @CFA_FLAGS@
    129130CFA_INCDIR = @CFA_INCDIR@
    130131CFA_LIBDIR = @CFA_LIBDIR@
  • config.h.in

    r07bc165 r6e4b913  
    66/* Location of cfa command. */
    77#undef CFA_BINDIR
     8
     9/* compilation flags for cfa libraries and test programs. */
     10#undef CFA_FLAGS
    811
    912/* Location of include files. */
  • configure

    r07bc165 r6e4b913  
    639639CXXFLAGS
    640640CXX
     641CFA_FLAGS
    641642CFA_LIBDIR
    642643CFA_BINDIR
     
    24562457
    24572458if test "x${CXXFLAGS}" = "x"; then
    2458    export CXXFLAGS="-std=c++11 -g -O2 ${CXXFLAGS}"
    2459 else
    2460    export CXXFLAGS="-std=c++11 ${CXXFLAGS}"
     2459   export CXXFLAGS="-std=c++11 -g ${CXXFLAGS}"  # defaults, no -O2 for debugging and failures
     2460else
     2461   export CXXFLAGS="-std=c++11 ${CXXFLAGS}"     # flags from configure command
    24612462fi
    24622463
     
    29612962  MAINT=$MAINTAINER_MODE_TRUE
    29622963
    2963         # may require auto* software to be installed
     2964                        # may require auto* software to be installed
    29642965
    29652966# Installation paths
     
    29732974fi
    29742975
    2975 if test "x$backendcompiler" != x; then
     2976if test "x$backendcompiler" != "x"; then
    29762977        BACKEND_CC=${backendcompiler}
    29772978else
     
    30153016fi
    30163017
    3017 
     3018        # check gcc installed
    30183019        if test "x$BACKEND_CC" = "x"; then
    30193020                as_fn_error $? "some version of gcc is needed. Get it at ftp://ftp.gnu.org" "$LINENO" 5
     
    30783079
    30793080CFA_LIBDIR=${cfa_libdir}
     3081
     3082
     3083
     3084cat >>confdefs.h <<_ACEOF
     3085#define CFA_FLAGS "${CFAFLAGS}"
     3086_ACEOF
     3087
     3088CFA_FLAGS=${CFAFLAGS}
    30803089
    30813090
  • configure.ac

    r07bc165 r6e4b913  
    1010
    1111if test "x${CXXFLAGS}" = "x"; then
    12    export CXXFLAGS="-std=c++11 -g -O2 ${CXXFLAGS}"
     12   export CXXFLAGS="-std=c++11 -g ${CXXFLAGS}"  # defaults, no -O2 for debugging and failures
    1313else
    14    export CXXFLAGS="-std=c++11 ${CXXFLAGS}"
     14   export CXXFLAGS="-std=c++11 ${CXXFLAGS}"     # flags from configure command
    1515fi
    1616
    1717AM_INIT_AUTOMAKE
    18 AM_MAINTAINER_MODE(enable)      # may require auto* software to be installed
     18AM_MAINTAINER_MODE(enable)                      # may require auto* software to be installed
    1919
    2020# Installation paths
     
    2323        [  --with-backend-compiler=PROGRAM     PROGRAM that performs the final code compilation (must be gcc-compatible) ],
    2424        backendcompiler=$withval, backendcompiler="")
    25 if test "x$backendcompiler" != x; then
     25if test "x$backendcompiler" != "x"; then
    2626        BACKEND_CC=${backendcompiler}
    2727else
    28         AC_PATH_PROG(BACKEND_CC, gcc, [])
     28        AC_PATH_PROG(BACKEND_CC, gcc, [])       # check gcc installed
    2929        if test "x$BACKEND_CC" = "x"; then
    3030                AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)
     
    6666AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
    6767AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
     68
     69AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
     70AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
    6871
    6972# Checks for programs.
  • src/Makefile.am

    r07bc165 r6e4b913  
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri Feb 26 17:19:16 2016
    14 ## Update Count     : 57
     13## Last Modified On : Fri Jul  8 12:22:25 2016
     14## Update Count     : 60
    1515###############################################################################
    1616
     
    4646driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL
    4747
    48 CXXFLAGS = -g -std=c++11                # remove default -O2 to allow better debugging
     48AM_CXXFLAGS = -g -std=c++11
    4949
    5050MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
  • src/Makefile.in

    r07bc165 r6e4b913  
    272272CFA_BACKEND_CC = @CFA_BACKEND_CC@
    273273CFA_BINDIR = @CFA_BINDIR@
     274CFA_FLAGS = @CFA_FLAGS@
    274275CFA_INCDIR = @CFA_INCDIR@
    275276CFA_LIBDIR = @CFA_LIBDIR@
     
    280281CXX = @CXX@
    281282CXXDEPMODE = @CXXDEPMODE@
    282 CXXFLAGS = -g -std=c++11                # remove default -O2 to allow better debugging
     283CXXFLAGS = @CXXFLAGS@
    283284CYGPATH_W = @CYGPATH_W@
    284285DEFS = @DEFS@
     
    430431# need files Common/utility.h
    431432driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL
     433AM_CXXFLAGS = -g -std=c++11
    432434all: $(BUILT_SOURCES)
    433435        $(MAKE) $(AM_MAKEFLAGS) all-am
  • src/driver/Makefile.in

    r07bc165 r6e4b913  
    9595CFA_BACKEND_CC = @CFA_BACKEND_CC@
    9696CFA_BINDIR = @CFA_BINDIR@
     97CFA_FLAGS = @CFA_FLAGS@
    9798CFA_INCDIR = @CFA_INCDIR@
    9899CFA_LIBDIR = @CFA_LIBDIR@
  • src/driver/cfa.cc

    r07bc165 r6e4b913  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul  5 20:56:18 2016
    13 // Update Count     : 140
     12// Last Modified On : Thu Jul  7 08:56:01 2016
     13// Update Count     : 144
    1414//
    1515
     
    8787        bool cpp_flag = false;                                                          // -E or -M flag, preprocessor only
    8888        bool std_flag = false;                                                          // -std= flag
    89         bool debugging = false;                                                         // -g flag
    90         (void) debugging;                                                               // remove unused variable warning
     89        bool debugging __attribute(( unused )) = false;         // -g flag
    9190
    9291        const char *args[argc + 100];                                           // cfa command line values, plus some space for additional flags
     
    245244        } // if
    246245
     246        // add the CFA include-library paths, which allow direct access to header files without directory qualification
     247
    247248        args[nargs] = "-I" CFA_INCDIR;
    248249        nargs += 1;
  • src/examples/Makefile.in

    r07bc165 r6e4b913  
    104104CFA_BACKEND_CC = @CFA_BACKEND_CC@
    105105CFA_BINDIR = @CFA_BINDIR@
     106CFA_FLAGS = @CFA_FLAGS@
    106107CFA_INCDIR = @CFA_INCDIR@
    107108CFA_LIBDIR = @CFA_LIBDIR@
  • src/libcfa/Makefile.am

    r07bc165 r6e4b913  
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Tue Jul  5 20:52:31 2016
    14 ## Update Count     : 185
     13## Last Modified On : Fri Jul  8 23:05:11 2016
     14## Update Count     : 192
    1515###############################################################################
    1616
     
    2626# create extra forward types/declarations to reduce inclusion of library files
    2727extras.cf : extras.regx extras.c
    28         $(AM_V_GEN)@BACKEND_CC@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
     28        $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
    2929
    3030# create forward declarations for gcc builtins
     
    5151
    5252libcfa-prelude.o : libcfa-prelude.c
    53          $(AM_V_GEN)@BACKEND_CC@ -c -o $@ $<
     53         $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $<
    5454
    55 CFLAGS = -quiet -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2
     55CFLAGS = -quiet -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2
    5656CC = ${abs_top_srcdir}/src/driver/cfa
    5757
  • src/libcfa/Makefile.in

    r07bc165 r6e4b913  
    132132CFA_BACKEND_CC = @CFA_BACKEND_CC@
    133133CFA_BINDIR = @CFA_BINDIR@
     134CFA_FLAGS = @CFA_FLAGS@
    134135CFA_INCDIR = @CFA_INCDIR@
    135136CFA_LIBDIR = @CFA_LIBDIR@
    136137CFA_PREFIX = @CFA_PREFIX@
    137 CFLAGS = -quiet -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2
     138CFLAGS = -quiet -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2
    138139CPP = @CPP@
    139140CPPFLAGS = @CPPFLAGS@
     
    602603# create extra forward types/declarations to reduce inclusion of library files
    603604extras.cf : extras.regx extras.c
    604         $(AM_V_GEN)@BACKEND_CC@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
     605        $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
    605606
    606607# create forward declarations for gcc builtins
     
    625626
    626627libcfa-prelude.o : libcfa-prelude.c
    627          $(AM_V_GEN)@BACKEND_CC@ -c -o $@ $<
     628         $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $<
    628629
    629630# extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing
  • src/libcfa/extras.c

    r07bc165 r6e4b913  
    11#include <stddef.h>
    22#include <stdlib.h>
     3#include <stdio.h>
  • src/libcfa/extras.regx

    r07bc165 r6e4b913  
    1 typedef.* size_t
    2 typedef.* ptrdiff_t
     1typedef.* size_t;
     2typedef.* ptrdiff_t;
     3extern.* abort\(.*\).*
     4extern.* atexit\(.*\).*
    35extern.* exit\(.*\).*
    4 extern.* atexit\(.*\).*
    5 extern.* abort\(.*\).*
     6extern.* free\(.*\).*
     7extern.*\*malloc\(.*\).*
     8extern.* printf\(.*\).*
  • src/libcfa/limits.c

    r07bc165 r6e4b913  
    1010// Created On       : Wed Apr  6 18:06:52 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr  7 17:18:45 2016
    13 // Update Count     : 11
     12// Last Modified On : Fri Jul  8 13:23:33 2016
     13// Update Count     : 14
    1414//
    1515
     
    2020const short int MIN = -32768;
    2121const int MIN = -2147483648;
     22#if __WORDSIZE == 64
    2223const long int MIN = -9223372036854775807L - 1L;
     24#else
     25const long int MIN = (int)MIN;
     26#endif // M64
    2327const long long int MIN = -9223372036854775807LL - 1LL;
    2428
     
    2731const int MAX = 2147483647;
    2832const unsigned int MAX = 4294967295_U;
     33#if __WORDSIZE == 64
    2934const long int MAX = 9223372036854775807_L;
     35#else
     36const long int MAX = (int)MAX;
     37#endif // M64
    3038const unsigned long int MAX = 4294967295_U;
    3139const long long int MAX = 9223372036854775807_LL;
  • src/libcfa/rational.c

    r07bc165 r6e4b913  
    1010// Created On       : Wed Apr  6 17:54:28 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul  5 18:29:12 2016
    13 // Update Count     : 26
     12// Last Modified On : Sat Jul  9 11:18:04 2016
     13// Update Count     : 40
    1414//
    1515
     
    3131// alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm
    3232static long int gcd( long int a, long int b ) {
    33     for ( ;; ) {                                                                                // Euclid's algorithm
     33        for ( ;; ) {                                                                            // Euclid's algorithm
    3434                long int r = a % b;
    3535          if ( r == 0 ) break;
    3636                a = b;
    3737                b = r;
    38     } // for
     38        } // for
    3939        return b;
    4040} // gcd
    4141
    4242static long int simplify( long int *n, long int *d ) {
    43     if ( *d == 0 ) {
     43        if ( *d == 0 ) {
    4444                serr | "Invalid rational number construction: denominator cannot be equal to 0." | endl;
    4545                exit( EXIT_FAILURE );
    46     } // exit
    47     if ( *d < 0 ) { *d = -*d; *n = -*n; }                               // move sign to numerator
    48     return gcd( abs( *n ), *d );                                                // simplify
     46        } // exit
     47        if ( *d < 0 ) { *d = -*d; *n = -*n; }                           // move sign to numerator
     48        return gcd( abs( *n ), *d );                                            // simplify
    4949} // Rationalnumber::simplify
    5050
     
    5353
    5454void ?{}( Rational * r ) {
    55     r{ 0, 1 };
     55        r{ 0, 1 };
    5656} // rational
    5757
    5858void ?{}( Rational * r, long int n ) {
    59     r{ n, 1 };
     59        r{ n, 1 };
    6060} // rational
    6161
    6262void ?{}( Rational * r, long int n, long int d ) {
    63     long int t = simplify( &n, &d );                                    // simplify
    64     r->numerator = n / t;
     63        long int t = simplify( &n, &d );                                        // simplify
     64        r->numerator = n / t;
    6565        r->denominator = d / t;
    6666} // rational
     
    7070
    7171long int numerator( Rational r ) {
    72     return r.numerator;
     72        return r.numerator;
    7373} // numerator
    7474
    7575long int numerator( Rational r, long int n ) {
    76     long int prev = r.numerator;
    77     long int t = gcd( abs( n ), r.denominator );                // simplify
    78     r.numerator = n / t;
    79     r.denominator = r.denominator / t;
    80     return prev;
     76        long int prev = r.numerator;
     77        long int t = gcd( abs( n ), r.denominator );            // simplify
     78        r.numerator = n / t;
     79        r.denominator = r.denominator / t;
     80        return prev;
    8181} // numerator
    8282
    8383long int denominator( Rational r ) {
    84     return r.denominator;
     84        return r.denominator;
    8585} // denominator
    8686
    8787long int denominator( Rational r, long int d ) {
    88     long int prev = r.denominator;
    89     long int t = simplify( &r.numerator, &d );                  // simplify
    90     r.numerator = r.numerator / t;
    91     r.denominator = d / t;
    92     return prev;
     88        long int prev = r.denominator;
     89        long int t = simplify( &r.numerator, &d );                      // simplify
     90        r.numerator = r.numerator / t;
     91        r.denominator = d / t;
     92        return prev;
    9393} // denominator
    9494
     
    9797
    9898int ?==?( Rational l, Rational r ) {
    99     return l.numerator * r.denominator == l.denominator * r.numerator;
     99        return l.numerator * r.denominator == l.denominator * r.numerator;
    100100} // ?==?
    101101
    102102int ?!=?( Rational l, Rational r ) {
    103     return ! ( l == r );
     103        return ! ( l == r );
    104104} // ?!=?
    105105
    106106int ?<?( Rational l, Rational r ) {
    107     return l.numerator * r.denominator < l.denominator * r.numerator;
     107        return l.numerator * r.denominator < l.denominator * r.numerator;
    108108} // ?<?
    109109
    110110int ?<=?( Rational l, Rational r ) {
    111     return l < r || l == r;
     111        return l < r || l == r;
    112112} // ?<=?
    113113
    114114int ?>?( Rational l, Rational r ) {
    115     return ! ( l <= r );
     115        return ! ( l <= r );
    116116} // ?>?
    117117
    118118int ?>=?( Rational l, Rational r ) {
    119     return ! ( l < r );
     119        return ! ( l < r );
    120120} // ?>=?
    121121
     
    125125Rational -?( Rational r ) {
    126126        Rational t = { -r.numerator, r.denominator };
    127     return t;
     127        return t;
    128128} // -?
    129129
    130130Rational ?+?( Rational l, Rational r ) {
    131     if ( l.denominator == r.denominator ) {                             // special case
     131        if ( l.denominator == r.denominator ) {                         // special case
    132132                Rational t = { l.numerator + r.numerator, l.denominator };
    133133                return t;
    134     } else {
     134        } else {
    135135                Rational t = { l.numerator * r.denominator + l.denominator * r.numerator, l.denominator * r.denominator };
    136136                return t;
    137     } // if
     137        } // if
    138138} // ?+?
    139139
    140140Rational ?-?( Rational l, Rational r ) {
    141     if ( l.denominator == r.denominator ) {                             // special case
     141        if ( l.denominator == r.denominator ) {                         // special case
    142142                Rational t = { l.numerator - r.numerator, l.denominator };
    143143                return t;
    144     } else {
     144        } else {
    145145                Rational t = { l.numerator * r.denominator - l.denominator * r.numerator, l.denominator * r.denominator };
    146146                return t;
    147     } // if
     147        } // if
    148148} // ?-?
    149149
    150150Rational ?*?( Rational l, Rational r ) {
    151     Rational t = { l.numerator * r.numerator, l.denominator * r.denominator };
     151        Rational t = { l.numerator * r.numerator, l.denominator * r.denominator };
    152152        return t;
    153153} // ?*?
    154154
    155155Rational ?/?( Rational l, Rational r ) {
    156     if ( r.numerator < 0 ) {
     156        if ( r.numerator < 0 ) {
    157157                r.numerator = -r.numerator;
    158158                r.denominator = -r.denominator;
    159159        } // if
    160160        Rational t = { l.numerator * r.denominator, l.denominator * r.numerator };
    161     return t;
     161        return t;
    162162} // ?/?
    163163
     
    169169} // widen
    170170
    171 // https://rosettacode.org/wiki/Convert_decimal_number_to_rational#C
     171// http://www.ics.uci.edu/~eppstein/numth/frap.c
    172172Rational narrow( double f, long int md ) {
    173173        if ( md <= 1 ) {                                                                        // maximum fractional digits too small?
     
    176176
    177177        // continued fraction coefficients
    178         long int a, h[3] = { 0, 1, 0 }, k[3] = { 1, 0, 0 };
    179         long int x, d, n = 1;
    180         int i, neg = 0;
    181  
    182         if ( f < 0 ) { neg = 1; f = -f; }
    183         while ( f != floor( f ) ) { n <<= 1; f *= 2; }
    184         d = f;
    185  
    186         // continued fraction and check denominator each step
    187         for (i = 0; i < 64; i++) {
    188                 a = n ? d / n : 0;
    189           if (i && !a) break;
    190                 x = d; d = n; n = x % n;
    191                 x = a;
    192                 if (k[1] * a + k[0] >= md) {
    193                         x = (md - k[0]) / k[1];
    194                   if ( ! (x * 2 >= a || k[1] >= md) ) break;
    195                         i = 65;
    196                 } // if
    197                 h[2] = x * h[1] + h[0]; h[0] = h[1]; h[1] = h[2];
    198                 k[2] = x * k[1] + k[0]; k[0] = k[1]; k[1] = k[2];
    199         } // for
    200         return (Rational){ neg ? -h[1] : h[1], k[1] };
     178        long int m00 = 1, m11 = 1, m01 = 0, m10 = 0;
     179        long int ai, t;
     180
     181        // find terms until denom gets too big
     182        for ( ;; ) {
     183                ai = (long int)f;
     184          if ( ! (m10 * ai + m11 <= md) ) break;
     185                t = m00 * ai + m01;
     186                m01 = m00;
     187                m00 = t;
     188                t = m10 * ai + m11;
     189                m11 = m10;
     190                m10 = t;
     191                t = (double)ai;
     192          if ( f == t ) break;                                                          // prevent division by zero
     193                f = 1 / (f - t);
     194          if ( f > (double)0x7FFFFFFF ) break;                          // representation failure
     195        }
     196        return (Rational){ m00, m10 };
    201197} // narrow
    202198
     
    207203istype * ?|?( istype *is, Rational *r ) {
    208204        long int t;
    209     is | &(r->numerator) | &(r->denominator);
     205        is | &(r->numerator) | &(r->denominator);
    210206        t = simplify( &(r->numerator), &(r->denominator) );
    211     r->numerator /= t;
    212     r->denominator /= t;
    213     return is;
     207        r->numerator /= t;
     208        r->denominator /= t;
     209        return is;
    214210} // ?|?
    215211
    216212forall( dtype ostype | ostream( ostype ) )
    217213ostype * ?|?( ostype *os, Rational r ) {
    218     return os | r.numerator | '/' | r.denominator;
     214        return os | r.numerator | '/' | r.denominator;
    219215} // ?|?
    220216
  • src/tests/.expect/extension.txt

    r07bc165 r6e4b913  
     1extern void *malloc(long unsigned int __size);
     2extern void free(void *__ptr);
    13extern void abort(void);
    24extern int atexit(void (*__func)(void));
    35extern void exit(int __status);
     6extern int printf(const char *__restrict __format, ...);
    47__extension__ int __a__i_1;
    58__extension__ int __b__i_1;
  • src/tests/.expect/gccExtensions.txt

    r07bc165 r6e4b913  
     1extern void *malloc(long unsigned int __size);
     2extern void free(void *__ptr);
    13extern void abort(void);
    24extern int atexit(void (*__func)(void));
    35extern void exit(int __status);
     6extern int printf(const char *__restrict __format, ...);
    47int main(int __argc__i_1, const char **__argv__PPCc_1){
    58    asm ( "nop" :  :  :  );
  • src/tests/Makefile.am

    r07bc165 r6e4b913  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jun 27 14:39:08 2016
    14 ## Update Count     : 34
     13## Last Modified On : Sat Jul  9 11:23:24 2016
     14## Update Count     : 35
    1515###############################################################################
    1616
    1717# applies to both programs
    18 CFLAGS = -g -Wall -Wno-unused-function # TEMPORARY: does not build with -O2
     18CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ # TEMPORARY: does not build with -O2
    1919CC = @CFA_BINDIR@/cfa
    2020
  • src/tests/Makefile.in

    r07bc165 r6e4b913  
    114114CFA_BACKEND_CC = @CFA_BACKEND_CC@
    115115CFA_BINDIR = @CFA_BINDIR@
     116CFA_FLAGS = @CFA_FLAGS@
    116117CFA_INCDIR = @CFA_INCDIR@
    117118CFA_LIBDIR = @CFA_LIBDIR@
     
    119120
    120121# applies to both programs
    121 CFLAGS = -g -Wall -Wno-unused-function # TEMPORARY: does not build with -O2
     122CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ # TEMPORARY: does not build with -O2
    122123CPP = @CPP@
    123124CPPFLAGS = @CPPFLAGS@
  • src/tests/avltree/avl.h

    r07bc165 r6e4b913  
    44extern "C" {
    55#define NULL 0
    6 void free(void *);
    76#define assert(cond) if (! (cond)) { printf("Assertion failed: (%s) at %s:%d\n", #cond, __FILE__, __LINE__); abort(); }
    8 int printf(const char *, ...);
    97}
    108
  • src/tests/avltree/avl1.c

    r07bc165 r6e4b913  
    11#include "avl.h"
    22// #include "cwrap.h"
    3 
    4 extern "C" {
    5   void * malloc(long int);
    6 }
    73
    84forall(otype K | Comparable(K), otype V)
  • src/tests/avltree/avl_test.c

    r07bc165 r6e4b913  
    33
    44extern "C" {
    5   int printf(const char *, ...);
    65  int strcmp(const char *, const char *);
    76}
  • src/tests/init_once.c

    r07bc165 r6e4b913  
    1010// Created On       : Tue Jun 14 15:43:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul  5 16:40:07 2016
    13 // Update Count     : 2
     12// Last Modified On : Sat Jul  9 11:30:29 2016
     13// Update Count     : 3
    1414//
    1515
     
    2323//*** setup
    2424extern "C" {
    25 typedef unsigned long int size_t;
    2625#define NULL 0
    2726void * malloc(size_t);
    2827void free(void *);
    2928#define assert(cond) if (! (cond)) { printf("Assertion failed: (%s) at %s:%d\n", #cond, __FILE__, __LINE__); abort(); }
    30 int printf(const char *, ...);
    3129void *memset(void *s, int c, size_t n);
    3230}
Note: See TracChangeset for help on using the changeset viewer.