I'm working on an Apple Macbook M1 ("Apple Silicon") which is an ARM platform.
g++ -c -Wall -pedantic -Wextra -Werror -I ~/include -O3 lsquare.cpp
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:58:4: note: in expansion of macro 'ldouble'
58 | ldouble *wtw, *uw;
| ^~~~~~~
lsquare.cpp: In function 'void* lsquare_init(int)':
lsquare.cpp:69:10: error: 'struct lsquare' has no member named 'uw'
69 | rval->uw = (ldouble *)calloc( (n_params + 1) * n_params, sizeof( ldouble));
| ^~
lsquare.cpp:48:20: error: '__float128' was not declared in this scope; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:69:16: note: in expansion of macro 'ldouble'
69 | rval->uw = (ldouble *)calloc( (n_params + 1) * n_params, sizeof( ldouble));
| ^~~~~~~
lsquare.cpp:69:25: error: expected primary-expression before ')' token
69 | rval->uw = (ldouble *)calloc( (n_params + 1) * n_params, sizeof( ldouble));
| ^
lsquare.cpp:70:10: error: 'struct lsquare' has no member named 'wtw'
70 | rval->wtw = rval->uw + n_params;
| ^~~
lsquare.cpp:70:22: error: 'struct lsquare' has no member named 'uw'
70 | rval->wtw = rval->uw + n_params;
| ^~
lsquare.cpp: In function 'int lsquare_add_observation(void*, double, double, const double*)':
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:115:13: note: in expansion of macro 'ldouble'
115 | const ldouble w2_obs_i = (ldouble)( weight * weight * obs[i]);
| ^~~~~~~
lsquare.cpp:117:12: error: 'struct lsquare' has no member named 'uw'
117 | lsq->uw[i] += (ldouble)residual * w2_obs_i;
| ^~
lsquare.cpp:48:20: error: '__float128' was not declared in this scope; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:117:22: note: in expansion of macro 'ldouble'
117 | lsq->uw[i] += (ldouble)residual * w2_obs_i;
| ^~~~~~~
lsquare.cpp:119:15: error: 'struct lsquare' has no member named 'wtw'
119 | lsq->wtw[i + j * n_params] += w2_obs_i * (ldouble)obs[j];
| ^~~
lsquare.cpp:119:40: error: 'w2_obs_i' was not declared in this scope
119 | lsq->wtw[i + j * n_params] += w2_obs_i * (ldouble)obs[j];
| ^~~~~~~~
lsquare.cpp:120:12: error: 'struct lsquare' has no member named 'wtw'
120 | lsq->wtw[i + i * n_params] +=
| ^~~
lsquare.cpp:121:19: error: 'w2_obs_i' was not declared in this scope
121 | w2_obs_i * (ldouble)( obs[i] * levenberg_marquardt_lambda);
| ^~~~~~~~
lsquare.cpp:106:58: error: unused parameter 'residual' [-Werror=unused-parameter]
106 | int lsquare_add_observation( void *lsquare, const double residual,
| ~~~~~~~~~~~~~^~~~~~~~
lsquare.cpp:107:48: error: unused parameter 'weight' [-Werror=unused-parameter]
107 | const double weight, const double *obs)
| ~~~~~~~~~~~~~^~~~~~
lsquare.cpp: At global scope:
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:127:1: note: in expansion of macro 'ldouble'
127 | ldouble lsquare_determinant;
| ^~~~~~~
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:160:8: note: in expansion of macro 'ldouble'
160 | static ldouble pivot_value( const ldouble *line, const unsigned line_size)
| ^~~~~~~
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:172:8: note: in expansion of macro 'ldouble'
172 | static ldouble *calc_inverse( const ldouble *src, const int size)
| ^~~~~~~
lsquare.cpp:353:13: error: variable or field 'mult_matrices' declared void
353 | static void mult_matrices( ldouble *prod, const ldouble *a, const int awidth,
| ^~~~~~~~~~~~~
lsquare.cpp:48:20: error: '__float128' was not declared in this scope; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:353:28: note: in expansion of macro 'ldouble'
353 | static void mult_matrices( ldouble *prod, const ldouble *a, const int awidth,
| ^~~~~~~
lsquare.cpp:353:37: error: 'prod' was not declared in this scope
353 | static void mult_matrices( ldouble *prod, const ldouble *a, const int awidth,
| ^~~~
lsquare.cpp:353:43: error: expected primary-expression before 'const'
353 | static void mult_matrices( ldouble *prod, const ldouble *a, const int awidth,
| ^~~~~
lsquare.cpp:353:61: error: expected primary-expression before 'const'
353 | static void mult_matrices( ldouble *prod, const ldouble *a, const int awidth,
| ^~~~~
lsquare.cpp:354:19: error: expected primary-expression before 'const'
354 | const int aheight, const ldouble *b, const int bwidth)
| ^~~~~
lsquare.cpp:354:38: error: expected primary-expression before 'const'
354 | const int aheight, const ldouble *b, const int bwidth)
| ^~~~~
lsquare.cpp:354:56: error: expected primary-expression before 'const'
354 | const int aheight, const ldouble *b, const int bwidth)
| ^~~~~
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:385:8: note: in expansion of macro 'ldouble'
385 | static ldouble *calc_inverse_improved( const ldouble *src, const int size)
| ^~~~~~~
lsquare.cpp: In function 'int lsquare_solve(const void*, double*)':
lsquare.cpp:48:20: error: '__float128' was not declared in this scope; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:428:4: note: in expansion of macro 'ldouble'
428 | ldouble *inverse;
| ^~~~~~~
lsquare.cpp:428:13: error: 'inverse' was not declared in this scope
428 | ldouble *inverse;
| ^~~~~~~
lsquare.cpp:434:42: error: 'const struct lsquare' has no member named 'wtw'
434 | inverse = calc_inverse_improved( lsq->wtw, n_params);
| ^~~
lsquare.cpp:434:14: error: 'calc_inverse_improved' was not declared in this scope
434 | inverse = calc_inverse_improved( lsq->wtw, n_params);
| ^~~~~~~~~~~~~~~~~~~~~
lsquare.cpp:440:15: error: expected ';' before 'temp_result'
440 | ldouble temp_result = 0;
| ^~~~~~~~~~~
lsquare.cpp:443:10: error: 'temp_result' was not declared in this scope
443 | temp_result += inverse[i + j * n_params] * lsq->uw[j];
| ^~~~~~~~~~~
lsquare.cpp:443:58: error: 'const struct lsquare' has no member named 'uw'
443 | temp_result += inverse[i + j * n_params] * lsq->uw[j];
| ^~
lsquare.cpp:444:27: error: 'temp_result' was not declared in this scope
444 | result[i] = (double)temp_result;
| ^~~~~~~~~~~
lsquare.cpp: At global scope:
lsquare.cpp:48:20: error: '__float128' does not name a type; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:451:56: note: in expansion of macro 'ldouble'
451 | static double *convert_ldouble_matrix_to_double( const ldouble *matrix,
| ^~~~~~~
lsquare.cpp: In function 'double* lsquare_covariance_matrix(const void*)':
lsquare.cpp:48:20: error: '__float128' was not declared in this scope; did you mean '_Float128'?
48 | #define ldouble __float128
| ^~~~~~~~~~
lsquare.cpp:465:4: note: in expansion of macro 'ldouble'
465 | ldouble *lrval = NULL;
| ^~~~~~~
lsquare.cpp:465:13: error: 'lrval' was not declared in this scope
465 | ldouble *lrval = NULL;
| ^~~~~
lsquare.cpp:468:43: error: 'const struct lsquare' has no member named 'wtw'
468 | lrval = calc_inverse_improved( lsq->wtw, lsq->n_params);
| ^~~
lsquare.cpp:468:15: error: 'calc_inverse_improved' was not declared in this scope
468 | lrval = calc_inverse_improved( lsq->wtw, lsq->n_params);
| ^~~~~~~~~~~~~~~~~~~~~
lsquare.cpp: In function 'double* lsquare_wtw_matrix(const void*)':
lsquare.cpp:485:51: error: 'const struct lsquare' has no member named 'wtw'
485 | return( convert_ldouble_matrix_to_double( lsq->wtw, lsq->n_params));
| ^~~
lsquare.cpp: In function 'void lsquare_free(void*)':
lsquare.cpp:492:15: error: 'const struct lsquare' has no member named 'uw'
492 | free( lsq->uw);
| ^~
lsquare.cpp: In function 'double* lsquare_covariance_matrix(const void*)':
lsquare.cpp:467:30: error: control reaches end of non-void function [-Werror=return-type]
467 | if( lsq->n_params <= lsq->n_obs) /* got enough observations */
| ~~~~~^~~~~
lsquare.cpp: At global scope:
lsquare.cpp:451:16: error: 'double* convert_ldouble_matrix_to_double(const int*, int)' defined but not used [-Werror=unused-function]
451 | static double *convert_ldouble_matrix_to_double( const ldouble *matrix,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~