cannot compile aldor

0 views
Skip to first unread message

Ralf Hemmecke

unread,
Feb 11, 2023, 3:58:36 PM2/11/23
to aldor-devel
Hi Pete,

I am at the master branch of the current aldor repository.

commit 859b69f0452de3fc09bcce14a3d3950f290909f0 (HEAD -> master,
upstream/master, origin/master)
Merge: 340d6de7 c815a2b6
Author: pbroadbery <p.bro...@gmail.com>
Date: Wed Mar 17 21:52:24 2021 +0000

Merge pull request #148 from aldorlang/pab/tweaks

Version 1.3.0 - Some minor fixes & a version bump

Unfortunately, I cannot compile aldor on Ubuntu 22.04.
It fails with the following lines.

Do you have any idea what goes wrong here?

Ralf

$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

=======================================================


CC libtest_a-file_t.o
CC libtest_a-float_t.o
/home/hemmecke/g/aldor/aldor/aldor/src/float_t.c: In function
‘testTruncate’:
/home/hemmecke/g/aldor/aldor/aldor/src/float_t.c:336:43: error:
expression does not compute the number of elements in this array;
element type is ‘FiSFlo’ {aka ‘float’}, not ‘FiDFlo’ {aka ‘double’}
[-Werror=sizeof-array-div]
336 | for (i = 0; i < sizeof(fv)/sizeof(FiDFlo); i++) {
| ^
/home/hemmecke/g/aldor/aldor/aldor/src/float_t.c:336:43: note: add
parentheses around the second ‘sizeof’ to silence this warning
/home/hemmecke/g/aldor/aldor/aldor/src/float_t.c:16:16: note: array ‘fv’
declared here
16 | static FiSFlo fv[] = {0.0f, 0.1f, 0.9f, 1.0f, 1.2f, 1.6f,
2.0f, 2.5f, 4.0f,
| ^~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:1706: libtest_a-float_t.o] Error 1
make[3]: Leaving directory '/dev/shm/hemmecke/aldor/aldor/src'
make[2]: *** [Makefile:1018: all] Error 2
make[2]: Leaving directory '/dev/shm/hemmecke/aldor/aldor/src'
make[1]: *** [Makefile:378: all-recursive] Error 1
make[1]: Leaving directory '/dev/shm/hemmecke/aldor/aldor'
make: *** [Makefile:599: all-recursive] Error 1

Peter Broadbery

unread,
Feb 11, 2023, 4:50:55 PM2/11/23
to Ralf Hemmecke, aldor-devel
Hi Ralf,

The error looks to be due to new gcc versions generating a new warning
(the default in Aldor is to treat warning as errors).
GCC 11 is the culprit here, so an older version will be ok.

There's three potential fixes:
- use '--disable-error-on-warning' when running configure
- Take heed of the warning, and modify the line to 'fv/sizeof(FiSFlo)'
- make 'CC=gcc-11'

I've not done a lot of work on aldor recently - pandemics and some
other bits and pieces have got in the way, but I'll update the tree
when I have a bit of spare time.

Hope all's well,

Peter
> --
> You received this message because you are subscribed to the Google Groups "aldor-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to aldor-devel...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/aldor-devel/c03bae4e-675a-55be-11d2-7c5323c2ff36%40hemmecke.org.
Reply all
Reply to author
Forward
0 new messages