Changeset 6fbe9a5
- Timestamp:
- Oct 7, 2020, 9:33:22 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8e4bc30
- Parents:
- 69c5c00
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/limits.cfa
r69c5c00 r6fbe9a5 10 10 // Created On : Wed Apr 6 18:06:52 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 30 22:56:32 202013 // Update Count : 7 612 // Last Modified On : Thu Mar 1 16:22:51 2018 13 // Update Count : 74 14 14 // 15 15 … … 23 23 // Integral Constants 24 24 25 signed char MIN = SCHAR_MIN;26 unsigned char MIN = 0;27 short int MIN = SHRT_MIN;28 unsigned short int MIN = 0;29 int MIN = INT_MIN;30 unsigned int MIN = 0;31 long int MIN = LONG_MIN;32 unsigned long int MIN = 0;33 long long int MIN = LLONG_MIN;34 unsigned long long int MIN = 0;25 const signed char MIN = SCHAR_MIN; 26 const unsigned char MIN = 0; 27 const short int MIN = SHRT_MIN; 28 const unsigned short int MIN = 0; 29 const int MIN = INT_MIN; 30 const unsigned int MIN = 0; 31 const long int MIN = LONG_MIN; 32 const unsigned long int MIN = 0; 33 const long long int MIN = LLONG_MIN; 34 const unsigned long long int MIN = 0; 35 35 36 signed char MAX = SCHAR_MAX;37 unsigned char MAX = UCHAR_MAX;38 short int MAX = SHRT_MAX;39 unsigned short int MAX = USHRT_MAX;40 int MAX = INT_MAX;41 unsigned int MAX = UINT_MAX;42 long int MAX = LONG_MAX;43 unsigned long int MAX = ULONG_MAX;44 long long int MAX = LLONG_MAX;45 unsigned long long int MAX = ULLONG_MAX;36 const signed char MAX = SCHAR_MAX; 37 const unsigned char MAX = UCHAR_MAX; 38 const short int MAX = SHRT_MAX; 39 const unsigned short int MAX = USHRT_MAX; 40 const int MAX = INT_MAX; 41 const unsigned int MAX = UINT_MAX; 42 const long int MAX = LONG_MAX; 43 const unsigned long int MAX = ULONG_MAX; 44 const long long int MAX = LLONG_MAX; 45 const unsigned long long int MAX = ULLONG_MAX; 46 46 47 47 // Floating-Point Constants 48 48 49 float MIN = FLT_MIN;50 double MIN = DBL_MIN;51 long double MIN = LDBL_MIN;52 float _Complex MIN = __FLT_MIN__ + __FLT_MIN__ * I;53 double _Complex MIN = DBL_MIN + DBL_MIN * I;54 long double _Complex MIN = LDBL_MIN + LDBL_MIN * I;49 const float MIN = FLT_MIN; 50 const double MIN = DBL_MIN; 51 const long double MIN = LDBL_MIN; 52 const float _Complex MIN = __FLT_MIN__ + __FLT_MIN__ * I; 53 const double _Complex MIN = DBL_MIN + DBL_MIN * I; 54 const long double _Complex MIN = LDBL_MIN + LDBL_MIN * I; 55 55 56 float MAX = FLT_MAX;57 double MAX = DBL_MAX;58 long double MAX = LDBL_MAX;59 float _Complex MAX = FLT_MAX + FLT_MAX * I;60 double _Complex MAX = DBL_MAX + DBL_MAX * I;61 long double _Complex MAX = LDBL_MAX + LDBL_MAX * I;56 const float MAX = FLT_MAX; 57 const double MAX = DBL_MAX; 58 const long double MAX = LDBL_MAX; 59 const float _Complex MAX = FLT_MAX + FLT_MAX * I; 60 const double _Complex MAX = DBL_MAX + DBL_MAX * I; 61 const long double _Complex MAX = LDBL_MAX + LDBL_MAX * I; 62 62 63 float PI = (float)M_PI;// pi64 float PI_2 = (float)M_PI_2;// pi / 265 float PI_4 = (float)M_PI_4;// pi / 466 float _1_PI = (float)M_1_PI;// 1 / pi67 float _2_PI = (float)M_2_PI;// 2 / pi68 float _2_SQRT_PI = (float)M_2_SQRTPI;// 2 / sqrt(pi)63 const float PI = (float)M_PI; // pi 64 const float PI_2 = (float)M_PI_2; // pi / 2 65 const float PI_4 = (float)M_PI_4; // pi / 4 66 const float _1_PI = (float)M_1_PI; // 1 / pi 67 const float _2_PI = (float)M_2_PI; // 2 / pi 68 const float _2_SQRT_PI = (float)M_2_SQRTPI; // 2 / sqrt(pi) 69 69 70 double PI = M_PI;// pi71 double PI_2 = M_PI_2;// pi / 272 double PI_4 = M_PI_4;// pi / 473 double _1_PI = M_1_PI;// 1 / pi74 double _2_PI = M_2_PI;// 2 / pi75 double _2_SQRT_PI = M_2_SQRTPI;// 2 / sqrt(pi)70 const double PI = M_PI; // pi 71 const double PI_2 = M_PI_2; // pi / 2 72 const double PI_4 = M_PI_4; // pi / 4 73 const double _1_PI = M_1_PI; // 1 / pi 74 const double _2_PI = M_2_PI; // 2 / pi 75 const double _2_SQRT_PI = M_2_SQRTPI; // 2 / sqrt(pi) 76 76 77 long double PI = M_PIl;// pi78 long double PI_2 = M_PI_2l;// pi / 279 long double PI_4 = M_PI_4l;// pi / 480 long double _1_PI = M_1_PIl;// 1 / pi81 long double _2_PI = M_2_PIl;// 2 / pi82 long double _2_SQRT_PI = M_2_SQRTPIl;// 2 / sqrt(pi)77 const long double PI = M_PIl; // pi 78 const long double PI_2 = M_PI_2l; // pi / 2 79 const long double PI_4 = M_PI_4l; // pi / 4 80 const long double _1_PI = M_1_PIl; // 1 / pi 81 const long double _2_PI = M_2_PIl; // 2 / pi 82 const long double _2_SQRT_PI = M_2_SQRTPIl; // 2 / sqrt(pi) 83 83 84 float _Complex PI = (float)M_PI + 0.0_iF;// pi85 float _Complex PI_2 = (float)M_PI_2 + 0.0_iF;// pi / 286 float _Complex PI_4 = (float)M_PI_4 + 0.0_iF;// pi / 487 float _Complex _1_PI = (float)M_1_PI + 0.0_iF;// 1 / pi88 float _Complex _2_PI = (float)M_2_PI + 0.0_iF;// 2 / pi89 float _Complex _2_SQRT_PI = (float)M_2_SQRTPI + 0.0_iF; // 2 / sqrt(pi)84 const float _Complex PI = (float)M_PI + 0.0_iF; // pi 85 const float _Complex PI_2 = (float)M_PI_2 + 0.0_iF; // pi / 2 86 const float _Complex PI_4 = (float)M_PI_4 + 0.0_iF; // pi / 4 87 const float _Complex _1_PI = (float)M_1_PI + 0.0_iF; // 1 / pi 88 const float _Complex _2_PI = (float)M_2_PI + 0.0_iF; // 2 / pi 89 const float _Complex _2_SQRT_PI = (float)M_2_SQRTPI + 0.0_iF; // 2 / sqrt(pi) 90 90 91 double _Complex PI = M_PI + 0.0_iD;// pi92 double _Complex PI_2 = M_PI_2 + 0.0_iD;// pi / 293 double _Complex PI_4 = M_PI_4 + 0.0_iD;// pi / 494 double _Complex _1_PI = M_1_PI + 0.0_iD;// 1 / pi95 double _Complex _2_PI = M_2_PI + 0.0_iD;// 2 / pi96 double _Complex _2_SQRT_PI = M_2_SQRTPI + 0.0_iD;// 2 / sqrt(pi)91 const double _Complex PI = M_PI + 0.0_iD; // pi 92 const double _Complex PI_2 = M_PI_2 + 0.0_iD; // pi / 2 93 const double _Complex PI_4 = M_PI_4 + 0.0_iD; // pi / 4 94 const double _Complex _1_PI = M_1_PI + 0.0_iD; // 1 / pi 95 const double _Complex _2_PI = M_2_PI + 0.0_iD; // 2 / pi 96 const double _Complex _2_SQRT_PI = M_2_SQRTPI + 0.0_iD; // 2 / sqrt(pi) 97 97 98 long double _Complex PI = M_PIl + 0.0_iL;// pi99 long double _Complex PI_2 = M_PI_2l + 0.0_iL;// pi / 2100 long double _Complex PI_4 = M_PI_4l + 0.0_iL;// pi / 4101 long double _Complex _1_PI = M_1_PIl + 0.0_iL;// 1 / pi102 long double _Complex _2_PI = M_2_PIl + 0.0_iL;// 2 / pi103 long double _Complex _2_SQRT_PI = M_2_SQRTPIl + 0.0_iL; // 2 / sqrt(pi)98 const long double _Complex PI = M_PIl + 0.0_iL; // pi 99 const long double _Complex PI_2 = M_PI_2l + 0.0_iL; // pi / 2 100 const long double _Complex PI_4 = M_PI_4l + 0.0_iL; // pi / 4 101 const long double _Complex _1_PI = M_1_PIl + 0.0_iL; // 1 / pi 102 const long double _Complex _2_PI = M_2_PIl + 0.0_iL; // 2 / pi 103 const long double _Complex _2_SQRT_PI = M_2_SQRTPIl + 0.0_iL; // 2 / sqrt(pi) 104 104 105 float E = (float)M_E;// e106 float LOG2_E = (float)M_LOG2E;// log_2(e)107 float LOG10_E = (float)M_LOG10E;// log_10(e)108 float LN_2 = (float)M_LN2;// log_e(2)109 float LN_10 = (float)M_LN10;// log_e(10)110 float SQRT_2 = (float)M_SQRT2;// sqrt(2)111 float _1_SQRT_2 = (float)M_SQRT1_2;// 1 / sqrt(2)105 const float E = (float)M_E; // e 106 const float LOG2_E = (float)M_LOG2E; // log_2(e) 107 const float LOG10_E = (float)M_LOG10E; // log_10(e) 108 const float LN_2 = (float)M_LN2; // log_e(2) 109 const float LN_10 = (float)M_LN10; // log_e(10) 110 const float SQRT_2 = (float)M_SQRT2; // sqrt(2) 111 const float _1_SQRT_2 = (float)M_SQRT1_2; // 1 / sqrt(2) 112 112 113 double E = M_E;// e114 double LOG2_E = M_LOG2E;// log_2(e)115 double LOG10_E = M_LOG10E;// log_10(e)116 double LN_2 = M_LN2;// log_e(2)117 double LN_10 = M_LN10;// log_e(10)118 double SQRT_2 = M_SQRT2;// sqrt(2)119 double _1_SQRT_2 = M_SQRT1_2;// 1 / sqrt(2)113 const double E = M_E; // e 114 const double LOG2_E = M_LOG2E; // log_2(e) 115 const double LOG10_E = M_LOG10E; // log_10(e) 116 const double LN_2 = M_LN2; // log_e(2) 117 const double LN_10 = M_LN10; // log_e(10) 118 const double SQRT_2 = M_SQRT2; // sqrt(2) 119 const double _1_SQRT_2 = M_SQRT1_2; // 1 / sqrt(2) 120 120 121 long double E = M_El;// e122 long double LOG2_E = M_LOG2El;// log_2(e)123 long double LOG10_E = M_LOG10El;// log_10(e)124 long double LN_2 = M_LN2l;// log_e(2)125 long double LN_10 = M_LN10l;// log_e(10)126 long double SQRT_2 = M_SQRT2l;// sqrt(2)127 long double _1_SQRT_2 = M_SQRT1_2l;// 1 / sqrt(2)121 const long double E = M_El; // e 122 const long double LOG2_E = M_LOG2El; // log_2(e) 123 const long double LOG10_E = M_LOG10El; // log_10(e) 124 const long double LN_2 = M_LN2l; // log_e(2) 125 const long double LN_10 = M_LN10l; // log_e(10) 126 const long double SQRT_2 = M_SQRT2l; // sqrt(2) 127 const long double _1_SQRT_2 = M_SQRT1_2l; // 1 / sqrt(2) 128 128 129 float _Complex E = M_E + 0.0_iF;// e130 float _Complex LOG2_E = M_LOG2E + 0.0_iF;// log_2(e)131 float _Complex LOG10_E = M_LOG10E + 0.0_iF;// log_10(e)132 float _Complex LN_2 = M_LN2 + 0.0_iF;// log_e(2)133 float _Complex LN_10 = M_LN10 + 0.0_iF;// log_e(10)134 float _Complex SQRT_2 = M_SQRT2 + 0.0_iF;// sqrt(2)135 float _Complex _1_SQRT_2 = M_SQRT1_2 + 0.0_iF;// 1 / sqrt(2)129 const float _Complex E = M_E + 0.0_iF; // e 130 const float _Complex LOG2_E = M_LOG2E + 0.0_iF; // log_2(e) 131 const float _Complex LOG10_E = M_LOG10E + 0.0_iF; // log_10(e) 132 const float _Complex LN_2 = M_LN2 + 0.0_iF; // log_e(2) 133 const float _Complex LN_10 = M_LN10 + 0.0_iF; // log_e(10) 134 const float _Complex SQRT_2 = M_SQRT2 + 0.0_iF; // sqrt(2) 135 const float _Complex _1_SQRT_2 = M_SQRT1_2 + 0.0_iF; // 1 / sqrt(2) 136 136 137 double _Complex E = M_E + 0.0_iD;// e138 double _Complex LOG2_E = M_LOG2E + 0.0_iD;// log_2(e)139 double _Complex LOG10_E = M_LOG10E + 0.0_iD;// log_10(e)140 double _Complex LN_2 = M_LN2 + 0.0_iD;// log_e(2)141 double _Complex LN_10 = M_LN10 + 0.0_iD;// log_e(10)142 double _Complex SQRT_2 = M_SQRT2 + 0.0_iD;// sqrt(2)143 double _Complex _1_SQRT_2 = M_SQRT1_2 + 0.0_iD;// 1 / sqrt(2)137 const double _Complex E = M_E + 0.0_iD; // e 138 const double _Complex LOG2_E = M_LOG2E + 0.0_iD; // log_2(e) 139 const double _Complex LOG10_E = M_LOG10E + 0.0_iD; // log_10(e) 140 const double _Complex LN_2 = M_LN2 + 0.0_iD; // log_e(2) 141 const double _Complex LN_10 = M_LN10 + 0.0_iD; // log_e(10) 142 const double _Complex SQRT_2 = M_SQRT2 + 0.0_iD; // sqrt(2) 143 const double _Complex _1_SQRT_2 = M_SQRT1_2 + 0.0_iD; // 1 / sqrt(2) 144 144 145 long double _Complex E = M_El + 0.0_iL;// e146 long double _Complex LOG2_E = M_LOG2El + 0.0_iL;// log_2(e)147 long double _Complex LOG10_E = M_LOG10El + 0.0_iL;// log_10(e)148 long double _Complex LN_2 = M_LN2l + 0.0_iL;// log_e(2)149 long double _Complex LN_10 = M_LN10l + 0.0_iL;// log_e(10)150 long double _Complex SQRT_2 = M_SQRT2l + 0.0_iL;// sqrt(2)151 long double _Complex _1_SQRT_2 = M_SQRT1_2l + 0.0_iL;// 1 / sqrt(2)145 const long double _Complex E = M_El + 0.0_iL; // e 146 const long double _Complex LOG2_E = M_LOG2El + 0.0_iL; // log_2(e) 147 const long double _Complex LOG10_E = M_LOG10El + 0.0_iL; // log_10(e) 148 const long double _Complex LN_2 = M_LN2l + 0.0_iL; // log_e(2) 149 const long double _Complex LN_10 = M_LN10l + 0.0_iL; // log_e(10) 150 const long double _Complex SQRT_2 = M_SQRT2l + 0.0_iL; // sqrt(2) 151 const long double _Complex _1_SQRT_2 = M_SQRT1_2l + 0.0_iL; // 1 / sqrt(2) 152 152 153 153 // Local Variables: // -
libcfa/src/limits.hfa
r69c5c00 r6fbe9a5 10 10 // Created On : Wed Apr 6 18:06:52 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 30 22:56:35 202013 // Update Count : 1 512 // Last Modified On : Thu Mar 1 16:20:54 2018 13 // Update Count : 13 14 14 // 15 15 … … 18 18 // Integral Constants 19 19 20 extern signed char MIN;21 extern unsigned char MIN;22 extern short int MIN;23 extern unsigned short int MIN;24 extern int MIN;25 extern unsigned int MIN;26 extern long int MIN;27 extern unsigned long int MIN;28 extern long long int MIN;29 extern unsigned long long int MIN;20 extern const signed char MIN; 21 extern const unsigned char MIN; 22 extern const short int MIN; 23 extern const unsigned short int MIN; 24 extern const int MIN; 25 extern const unsigned int MIN; 26 extern const long int MIN; 27 extern const unsigned long int MIN; 28 extern const long long int MIN; 29 extern const unsigned long long int MIN; 30 30 31 extern signed char MAX;32 extern unsigned char MAX;33 extern short int MAX;34 extern unsigned short int MAX;35 extern int MAX;36 extern unsigned int MAX;37 extern long int MAX;38 extern unsigned long int MAX;39 extern long long int MAX;40 extern unsigned long long int MAX;31 extern const signed char MAX; 32 extern const unsigned char MAX; 33 extern const short int MAX; 34 extern const unsigned short int MAX; 35 extern const int MAX; 36 extern const unsigned int MAX; 37 extern const long int MAX; 38 extern const unsigned long int MAX; 39 extern const long long int MAX; 40 extern const unsigned long long int MAX; 41 41 42 42 // Floating-Point Constants 43 43 44 extern float MIN;45 extern double MIN;46 extern long double MIN;47 extern float _Complex MIN;48 extern double _Complex MIN;49 extern long double _Complex MIN;44 extern const float MIN; 45 extern const double MIN; 46 extern const long double MIN; 47 extern const float _Complex MIN; 48 extern const double _Complex MIN; 49 extern const long double _Complex MIN; 50 50 51 extern float MAX;52 extern double MAX;53 extern long double MAX;54 extern float _Complex MAX;55 extern double _Complex MAX;56 extern long double _Complex MAX;51 extern const float MAX; 52 extern const double MAX; 53 extern const long double MAX; 54 extern const float _Complex MAX; 55 extern const double _Complex MAX; 56 extern const long double _Complex MAX; 57 57 58 extern float PI;// pi59 extern float PI_2;// pi / 260 extern float PI_4;// pi / 461 extern float _1_PI;// 1 / pi62 extern float _2_PI;// 2 / pi63 extern float _2_SQRT_PI;// 2 / sqrt(pi)58 extern const float PI; // pi 59 extern const float PI_2; // pi / 2 60 extern const float PI_4; // pi / 4 61 extern const float _1_PI; // 1 / pi 62 extern const float _2_PI; // 2 / pi 63 extern const float _2_SQRT_PI; // 2 / sqrt(pi) 64 64 65 extern double PI;// pi66 extern double PI_2;// pi / 267 extern double PI_4;// pi / 468 extern double _1_PI;// 1 / pi69 extern double _2_PI;// 2 / pi70 extern double _2_SQRT_PI;// 2 / sqrt(pi)65 extern const double PI; // pi 66 extern const double PI_2; // pi / 2 67 extern const double PI_4; // pi / 4 68 extern const double _1_PI; // 1 / pi 69 extern const double _2_PI; // 2 / pi 70 extern const double _2_SQRT_PI; // 2 / sqrt(pi) 71 71 72 extern long double PI;// pi73 extern long double PI_2;// pi / 274 extern long double PI_4;// pi / 475 extern long double _1_PI;// 1 / pi76 extern long double _2_PI;// 2 / pi77 extern long double _2_SQRT_PI;// 2 / sqrt(pi)72 extern const long double PI; // pi 73 extern const long double PI_2; // pi / 2 74 extern const long double PI_4; // pi / 4 75 extern const long double _1_PI; // 1 / pi 76 extern const long double _2_PI; // 2 / pi 77 extern const long double _2_SQRT_PI; // 2 / sqrt(pi) 78 78 79 extern float _Complex PI;// pi80 extern float _Complex PI_2;// pi / 281 extern float _Complex PI_4;// pi / 482 extern float _Complex _1_PI;// 1 / pi83 extern float _Complex _2_PI;// 2 / pi84 extern float _Complex _2_SQRT_PI;// 2 / sqrt(pi)79 extern const float _Complex PI; // pi 80 extern const float _Complex PI_2; // pi / 2 81 extern const float _Complex PI_4; // pi / 4 82 extern const float _Complex _1_PI; // 1 / pi 83 extern const float _Complex _2_PI; // 2 / pi 84 extern const float _Complex _2_SQRT_PI; // 2 / sqrt(pi) 85 85 86 extern double _Complex PI;// pi87 extern double _Complex PI_2;// pi / 288 extern double _Complex PI_4;// pi / 489 extern double _Complex _1_PI;// 1 / pi90 extern double _Complex _2_PI;// 2 / pi91 extern double _Complex _2_SQRT_PI;// 2 / sqrt(pi)86 extern const double _Complex PI; // pi 87 extern const double _Complex PI_2; // pi / 2 88 extern const double _Complex PI_4; // pi / 4 89 extern const double _Complex _1_PI; // 1 / pi 90 extern const double _Complex _2_PI; // 2 / pi 91 extern const double _Complex _2_SQRT_PI; // 2 / sqrt(pi) 92 92 93 extern long double _Complex PI;// pi94 extern long double _Complex PI_2;// pi / 295 extern long double _Complex PI_4;// pi / 496 extern long double _Complex _1_PI;// 1 / pi97 extern long double _Complex _2_PI;// 2 / pi98 extern long double _Complex _2_SQRT_PI;// 2 / sqrt(pi)93 extern const long double _Complex PI; // pi 94 extern const long double _Complex PI_2; // pi / 2 95 extern const long double _Complex PI_4; // pi / 4 96 extern const long double _Complex _1_PI; // 1 / pi 97 extern const long double _Complex _2_PI; // 2 / pi 98 extern const long double _Complex _2_SQRT_PI; // 2 / sqrt(pi) 99 99 100 extern float E;// e101 extern float LOG2_E;// log_2(e)102 extern float LOG10_E;// log_10(e)103 extern float LN_2;// log_e(2)104 extern float LN_10;// log_e(10)105 extern float SQRT_2;// sqrt(2)106 extern float _1_SQRT_2;// 1 / sqrt(2)100 extern const float E; // e 101 extern const float LOG2_E; // log_2(e) 102 extern const float LOG10_E; // log_10(e) 103 extern const float LN_2; // log_e(2) 104 extern const float LN_10; // log_e(10) 105 extern const float SQRT_2; // sqrt(2) 106 extern const float _1_SQRT_2; // 1 / sqrt(2) 107 107 108 extern double E;// e109 extern double LOG2_E;// log_2(e)110 extern double LOG10_E;// log_10(e)111 extern double LN_2;// log_e(2)112 extern double LN_10;// log_e(10)113 extern double SQRT_2;// sqrt(2)114 extern double _1_SQRT_2;// 1 / sqrt(2)108 extern const double E; // e 109 extern const double LOG2_E; // log_2(e) 110 extern const double LOG10_E; // log_10(e) 111 extern const double LN_2; // log_e(2) 112 extern const double LN_10; // log_e(10) 113 extern const double SQRT_2; // sqrt(2) 114 extern const double _1_SQRT_2; // 1 / sqrt(2) 115 115 116 extern long double E;// e117 extern long double LOG2_E;// log_2(e)118 extern long double LOG10_E;// log_10(e)119 extern long double LN_2;// log_e(2)120 extern long double LN_10;// log_e(10)121 extern long double SQRT_2;// sqrt(2)122 extern long double _1_SQRT_2;// 1/sqrt(2)116 extern const long double E; // e 117 extern const long double LOG2_E; // log_2(e) 118 extern const long double LOG10_E; // log_10(e) 119 extern const long double LN_2; // log_e(2) 120 extern const long double LN_10; // log_e(10) 121 extern const long double SQRT_2; // sqrt(2) 122 extern const long double _1_SQRT_2; // 1/sqrt(2) 123 123 124 extern float _Complex E;// e125 extern float _Complex LOG2_E;// log_2(e)126 extern float _Complex LOG10_E;// log_10(e)127 extern float _Complex LN_2;// log_e(2)128 extern float _Complex LN_10;// log_e(10)129 extern float _Complex SQRT_2;// sqrt(2)130 extern float _Complex _1_SQRT_2;// 1 / sqrt(2)124 extern const float _Complex E; // e 125 extern const float _Complex LOG2_E; // log_2(e) 126 extern const float _Complex LOG10_E; // log_10(e) 127 extern const float _Complex LN_2; // log_e(2) 128 extern const float _Complex LN_10; // log_e(10) 129 extern const float _Complex SQRT_2; // sqrt(2) 130 extern const float _Complex _1_SQRT_2; // 1 / sqrt(2) 131 131 132 extern double _Complex E;// e133 extern double _Complex LOG2_E;// log_2(e)134 extern double _Complex LOG10_E;// log_10(e)135 extern double _Complex LN_2;// log_e(2)136 extern double _Complex LN_10;// log_e(10)137 extern double _Complex SQRT_2;// sqrt(2)138 extern double _Complex _1_SQRT_2;// 1 / sqrt(2)132 extern const double _Complex E; // e 133 extern const double _Complex LOG2_E; // log_2(e) 134 extern const double _Complex LOG10_E; // log_10(e) 135 extern const double _Complex LN_2; // log_e(2) 136 extern const double _Complex LN_10; // log_e(10) 137 extern const double _Complex SQRT_2; // sqrt(2) 138 extern const double _Complex _1_SQRT_2; // 1 / sqrt(2) 139 139 140 extern long double _Complex E;// e141 extern long double _Complex LOG2_E;// log_2(e)142 extern long double _Complex LOG10_E;// log_10(e)143 extern long double _Complex LN_2;// log_e(2)144 extern long double _Complex LN_10;// log_e(10)145 extern long double _Complex SQRT_2;// sqrt(2)146 extern long double _Complex _1_SQRT_2;// 1 / sqrt(2)140 extern const long double _Complex E; // e 141 extern const long double _Complex LOG2_E; // log_2(e) 142 extern const long double _Complex LOG10_E; // log_10(e) 143 extern const long double _Complex LN_2; // log_e(2) 144 extern const long double _Complex LN_10; // log_e(10) 145 extern const long double _Complex SQRT_2; // sqrt(2) 146 extern const long double _Complex _1_SQRT_2; // 1 / sqrt(2) 147 147 148 148 // Local Variables: // -
src/InitTweak/FixGlobalInit.cc
r69c5c00 r6fbe9a5 112 112 } // if 113 113 if ( Statement * ctor = ctorInit->ctor ) { 114 // Translation 1: Add this attribute on the global declaration: 115 // __attribute__((section (".data#"))) 116 // which makes gcc put the global in the data section, 117 // so that the global is writeable (via a const cast) in the init function. 118 // The trailing # is an injected assembly comment, to suppress the "a" in 119 // .section .data,"a" 120 // .section .data#,"a" 121 // to avoid assembler warning "ignoring changed section attributes for .data" 122 Type *strLitT = new PointerType( Type::Qualifiers( ), 123 new BasicType( Type::Qualifiers( ), BasicType::Char ) ); 124 std::list< Expression * > attr_params; 125 attr_params.push_back( 126 new ConstantExpr( Constant( strLitT, "\".data#\"", std::nullopt ) ) ); 127 objDecl->attributes.push_back(new Attribute("section", attr_params)); 128 // Translation 2: Move the initizliation off the global declaration, 129 // into the startup function. 114 130 initStatements.push_back( ctor ); 115 131 objDecl->init = nullptr; -
tests/.expect/limits.txt
r69c5c00 r6fbe9a5 1 1 limits.cfa: In function '_X4mainFi_iPPKc__1': 2 limits.cfa:15 1:9: note: #pragma message: Compiled2 limits.cfa:154:9: note: #pragma message: Compiled -
tests/limits.cfa
r69c5c00 r6fbe9a5 13 13 // Update Count : 10 14 14 // 15 16 // Note: For testing the ability to load the constants defined in libcfa/src/limits.cfa, 17 // see discussion in test const-init. 15 18 16 19 #include <limits.hfa>
Note: See TracChangeset
for help on using the changeset viewer.