Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aalloc.h:188:50: error: 'size' undeclared; Aalloc.h:188:41: error: too many arguments to function 'free' #1

Open
barracuda156 opened this issue Jan 26, 2023 · 3 comments
Assignees

Comments

@barracuda156
Copy link

The build, strangely, proceeds, but spits out these errors:

In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahsweep.c:61:
Ahsweep.c: In function 'Agc_sweep':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:50: error: 'size' undeclared (first use in this function)
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                                  ^~~~
Ahbitmap.h:197:25: note: in expansion of macro 'A_GC_FREE'
  197 | #define BMAP_FREE(n)    A_GC_FREE(n)
      |                         ^~~~~~~~~
Ahbitmap.h:210:49: note: in expansion of macro 'BMAP_FREE'
  210 | #define FREE_BITMAP(bitmap_LVALUE,elems)        BMAP_FREE((PTR)(bitmap_LVALUE))
      |                                                 ^~~~~~~~~
Ahsweep.c:346:9: note: in expansion of macro 'FREE_BITMAP'
  346 |         FREE_BITMAP( bitmap, SEGELS( segctlp ) + 3 );
      |         ^~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:50: note: each undeclared identifier is reported only once for each function it appears in
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                                  ^~~~
Ahbitmap.h:197:25: note: in expansion of macro 'A_GC_FREE'
  197 | #define BMAP_FREE(n)    A_GC_FREE(n)
      |                         ^~~~~~~~~
Ahbitmap.h:210:49: note: in expansion of macro 'BMAP_FREE'
  210 | #define FREE_BITMAP(bitmap_LVALUE,elems)        BMAP_FREE((PTR)(bitmap_LVALUE))
      |                                                 ^~~~~~~~~
Ahsweep.c:346:9: note: in expansion of macro 'FREE_BITMAP'
  346 |         FREE_BITMAP( bitmap, SEGELS( segctlp ) + 3 );
      |         ^~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:41: error: too many arguments to function 'free'
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                         ^~~~
Ahbitmap.h:197:25: note: in expansion of macro 'A_GC_FREE'
  197 | #define BMAP_FREE(n)    A_GC_FREE(n)
      |                         ^~~~~~~~~
Ahbitmap.h:210:49: note: in expansion of macro 'BMAP_FREE'
  210 | #define FREE_BITMAP(bitmap_LVALUE,elems)        BMAP_FREE((PTR)(bitmap_LVALUE))
      |                                                 ^~~~~~~~~
Ahsweep.c:346:9: note: in expansion of macro 'FREE_BITMAP'
  346 |         FREE_BITMAP( bitmap, SEGELS( segctlp ) + 3 );
      |         ^~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:63,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahsweep.c:61:
/usr/include/stdlib.h:160:10: note: declared here
  160 | void     free(void *);
      |          ^~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahsweep.c:61:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:41: error: too many arguments to function 'free'
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                         ^~~~
Ahseg.h:312:33: note: in expansion of macro 'A_GC_FREE'
  312 | #define FREE_SEG( segctlp )     A_GC_FREE((PTR)(segctlp))
      |                                 ^~~~~~~~~
Ahsweep.c:358:9: note: in expansion of macro 'FREE_SEG'
  358 |         FREE_SEG( segctlp );
      |         ^~~~~~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:63,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahsweep.c:61:
/usr/include/stdlib.h:160:10: note: declared here
  160 | void     free(void *);
      |          ^~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahsweep.c:61:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:41: error: too many arguments to function 'free'
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                         ^~~~
Ahbitmap.h:197:25: note: in expansion of macro 'A_GC_FREE'
  197 | #define BMAP_FREE(n)    A_GC_FREE(n)
      |                         ^~~~~~~~~
Ahbitmap.h:210:49: note: in expansion of macro 'BMAP_FREE'
  210 | #define FREE_BITMAP(bitmap_LVALUE,elems)        BMAP_FREE((PTR)(bitmap_LVALUE))
      |                                                 ^~~~~~~~~
Ahsweep.c:432:5: note: in expansion of macro 'FREE_BITMAP'
  432 |     FREE_BITMAP( bitmap, SEGELS( segctlp ) + 3 );
      |     ^~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:63,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahsweep.c:61:
/usr/include/stdlib.h:160:10: note: declared here
  160 | void     free(void *);
      |          ^~~~
make[1]: *** [Ahsweep.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Amacros.h:68,
                 from Ahdebug.h:55,
                 from Ahtrace.c:58:
Ahtrace.c: In function 'Agc_trace':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:50: error: 'size' undeclared (first use in this function)
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                                  ^~~~
Aharea.h:142:3: note: in expansion of macro 'A_GC_FREE'
  142 |   A_GC_FREE((char *)(stack).bottom);                                                                     \
      |   ^~~~~~~~~
Ahtrace.c:407:3: note: in expansion of macro 'FREE_STACK'
  407 |   FREE_STACK(tstack);
      |   ^~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:50: note: each undeclared identifier is reported only once for each function it appears in
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                                  ^~~~
Aharea.h:142:3: note: in expansion of macro 'A_GC_FREE'
  142 |   A_GC_FREE((char *)(stack).bottom);                                                                     \
      |   ^~~~~~~~~
Ahtrace.c:407:3: note: in expansion of macro 'FREE_STACK'
  407 |   FREE_STACK(tstack);
      |   ^~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_algol-68rs/algol-68rs/work/Algol-68RS-Source-ef25e71aa7d45f602ad464dd28059be3834db173/include/algol68/Aalloc.h:188:41: error: too many arguments to function 'free'
  188 | #define A_GC_FREE(ptr)                  free(ptr,size)
      |                                         ^~~~
Aharea.h:142:3: note: in expansion of macro 'A_GC_FREE'
  142 |   A_GC_FREE((char *)(stack).bottom);                                                                     \
      |   ^~~~~~~~~
Ahtrace.c:407:3: note: in expansion of macro 'FREE_STACK'
  407 |   FREE_STACK(tstack);
      |   ^~~~~~~~~~
In file included from Ahtrace.c:50:
/usr/include/stdlib.h:160:10: note: declared here
  160 | void     free(void *);
      |          ^~~~
make[1]: *** [Ahtrace.o] Error 1

macOS 10.6.8, gcc11

@coolbikerdad coolbikerdad self-assigned this Jan 26, 2023
@coolbikerdad
Copy link
Owner

Hi

The compiler here is derived from a port of a68toc to 32-bit Intel i386 that I have extended to 64-bit Intel and 32- and 64-bit ARM CPUs on Linux and MacOS. I have not attempted to compile it for other architectures such as PowerPC (PPC) as you are attempting here. In extending it, the biggest problem was porting the garbage collector (it has some hard assumptions about word size) which is why I included the external BDW garbage collector. You might try compiling without garbage collection to see if that works - it is a config option and/or using BDW gc. As I don’t have my PPC Macs setup right now, I cannot be of much more help at this time.

Neil

@barracuda156
Copy link
Author

@coolbikerdad Thank you for responding! I made initial fixes for PPC, and errors do not look arch-specific. Once the build is clean, I will make a PR.

We have that garbage collector in Macports, and it builds for all archs and systems: https://ports.macports.org/port/boehmgc/details
I will see if I can set Macports prefix for it and use external one. (But it should build perfectly fine anyway – and the source code has defines for Darwin PPC, though in one spot they are messed a bit.)

@barracuda156
Copy link
Author

@coolbikerdad Apparently it is working:

macmini:examples svacchanda$ /opt/local/bin/ca ./Abundant_odd_numbers.a68
"./Abundant_odd_numbers.a68", line 34: WARNING (337) module name does not match source filename
"./Abundant_odd_numbers.a68", line 111: WARNING (801) Cannot open unique name seed file for reading
"./Abundant_odd_numbers.a68", line 111: WARNING (813) Using unique name "AAAAAAA"
End of diagnostics: 3 warning(s) in compilation
macmini:examples svacchanda$ /Users/svacchanda/Desktop/examples/Abundant_odd_numbers 
The first 25 abundant odd numbers:
   945 proper divisor sum: 975
  1575 proper divisor sum: 1649
  2205 proper divisor sum: 2241
  2835 proper divisor sum: 2973
  3465 proper divisor sum: 4023
  4095 proper divisor sum: 4641
  4725 proper divisor sum: 5195
  5355 proper divisor sum: 5877
  5775 proper divisor sum: 6129
  5985 proper divisor sum: 6495
  6435 proper divisor sum: 6669
  6615 proper divisor sum: 7065
  6825 proper divisor sum: 7063
  7245 proper divisor sum: 7731
  7425 proper divisor sum: 7455
  7875 proper divisor sum: 8349
  8085 proper divisor sum: 8331
  8415 proper divisor sum: 8433
  8505 proper divisor sum: 8967
  8925 proper divisor sum: 8931
  9135 proper divisor sum: 9585
  9555 proper divisor sum: 9597
  9765 proper divisor sum: 10203
 10395 proper divisor sum: 12645
 11025 proper divisor sum: 11946
1000th abundant odd number:
    492975 proper divisor sum: 519361
First abundant odd number > 1 000 000 000:
    1000000575 proper divisor sum: 1083561009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants