English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 16 August 2018, 04:53   #1
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
VBCC getting started help

Hi All,

I've been messing around with CBM 8 bit assembly and C (cc65), but wow, 64k (and it's never that much really) disappears quickly with C. I'd like to start playing around with an Amiga 1000 I've had for a long time, but never really used.

I've installed vbcc, but I can't compile anything. I get this error:
--
vbcc V0.9f (c) in 1995-2017 by Volker Barthelmann
vbcc code-generator for m68k/ColdFire V1.12 (c) in 1995-2017 by Volker Barthelmann
>
error 278 in line -1 of "nada.c": void macro name
1 error found!
--

I have reduced the code to this:
--
int main(void)
{
return 1;
}
--

According to the manual, error 278 is:
278. "void macro name" (Preprocessor, Error, ANSI-violation)

I started out with a hello world example using stdio.h, and I thought the error was maybe related to my configuration being wrong, but I played with the config file and the command line to test that if I made the paths bad, the include spat out its own file not found error, so it's not that. Anyway, getting down to no includes produces the same error.

I'm using a mac, installing following these guides:
https://blitterstudio.com/setting-up-an-amiga-cross-compiler/
http://lallafa.de/blog/2011/08/vbcc-0-9b-an-amiga-cross-compiler-for-mac-os-x/

Here's my command line:
vbccm68k -hunkdebug "nada.c" -o= "tmp0.asm" -c99 -O=1 -no-cpp-warn -I/opt/vbcc/targets/m68k-kick13/include/

I've tried with/without the -c99, with/without the no-cpp-warning. I also tried building for a higher OS version, and using vbccm68ks. All produce same error. Those flags do do things (// style comments produce errors, etc.).

I checked the file, and it's UTF8, unix line endings. I thought maybe it wasn't reading the file at all, but it reacts to comments, includes, etc., so I think it is able to parse the file.

This is my install dir:
-------------
/bin
--vasmm68k_mot
--vbccm68k
--vbccm68ks
--vc
--vlink
--vobjdump
--vprof

/config
--(the standard stuff I downloaded)

/NDK_1.3
--(stuff)

/targets
--m68k-amigaos
--m68k-kick13

Any ideas on what I might have done wrong?
Warty is offline  
Old 16 August 2018, 11:31   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
I think the default setting for VBCC is ANSI C 1999 so either switch it to C 1989 or put in the conventional "int argc, char *argv[]" as your input parameters for main. (Just guessing.)
Samurai_Crow is offline  
Old 16 August 2018, 14:23   #3
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
Switching to C89 (by removing -c99) doesn't change the error. Nor does c99+argc/argv. If I give it code with errors in it, it does call out those errors. Conversely, if I give it code I know compiles with other compilers, it doesn't report new errors, but it does say line -1, error 278.
Warty is offline  
Old 16 August 2018, 14:39   #4
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
How about

int main()

?
Hedeon is offline  
Old 16 August 2018, 14:56   #5
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
int main();

produces 1 error, the same line -1/278 one.
Warty is offline  
Old 16 August 2018, 15:57   #6
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
Normally you would compile with:

vc +aos68k -lvc -O2 -helloworld.c -o helloworld -I<insert your stuff here>

That's not for 1.3 of course...but you get the gist.
Hedeon is offline  
Old 16 August 2018, 16:18   #7
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
yes, I started there, same results. it was easier to just use the command line vc generates (and modify it) rather than edit the config and save. The vc commands I use:
--
vc +kick13 hello.c

vc +aos68k hello.c
--

I've tried re-compiling vbcc and other tools a few times (pretty sure this is purely about the vbcc binary though). I've looked through the vbcc source code a bit to try and find out what condition is causing it, but it's not immediately obvious to me. I'll try changing the error to a warning and seeing what happens. (weeee!) Probably nothing good...
Warty is offline  
Old 16 August 2018, 19:33   #8
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Do you have a BOM marker at the beginning of the source file maybe? Try removing it, or saving as Latin 1.

I've built and installed vbcc successfully on my Mac many times, and I think the problem is in your installation, not in vbcc itself.
Leffmann is offline  
Old 16 August 2018, 21:57   #9
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
I have neither seen this bug, nor did anybody ever report it to me. So my first assumption would be what Leffmann said: something went wrong with your vbccm68k compilation.

I didn't reply before, because I wanted to consult Volker first to hear his opinion about the source of this error message.

Quote:
Originally Posted by Warty View Post
error 278 in line -1 of "nada.c": void macro name
1 error found!
The "line -1" indicates that the error is not in the source you want to compile. It is either caused by a vbccm68k-internal macro definition or by a macro specified with -D on the command line.

Although I cannot reproduce the problem with your source and arguments, I can reproduce the error message by adding a "-D" option without a macro name on the command line!

Quote:
I'm using a mac, installing following these guides:
Building vbcc is straight forward, so I wonder what went wrong. The Mac is x86 64-bit, I assume?

I guess you replied with 'y', when the data type generator (dtgen) asked you if you want to build a cross-compiler? And then you replied all questions for the data types correctly, having the size and endianess of all data types from your host compiler in mind?

Which compiler did you use to build vbccm68k?

You might want to repeat the whole build process and document every step here. Delete machines/m68k/dt.c and dt.h, to force dtgen to rerun during "make TARGET=m68k".


Quote:
Here's my command line:
vbccm68k -hunkdebug "nada.c" -o= "tmp0.asm" -c99 -O=1 -no-cpp-warn -I/opt/vbcc/targets/m68k-kick13/include/
This command line definitely causes the error message? It would prove that the error results from an internal macro definition, as no -D option is given here.

In the worst case, if you don't manage to build vbcc youself, maybe somebody else can. Unfortunately not me, as I don't have any MacOS system with a working compiler (all my Macs are PPC and are either running NetBSD or MorphOS).
phx is offline  
Old 16 August 2018, 22:22   #10
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
A friend of mine had that error recently. After reinstalling all again It worked good so perhaps your setup is wrong.

Enviado desde mi SM-J530F mediante Tapatalk
tolkien is offline  
Old 16 August 2018, 22:53   #11
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
Thanks for the all replies!

BOM/encoding: I did actually play around with that, it didn't change anything. Latin1 got the same reaction as UTF8. When I add a BOM to the UTF8, that does produce a different error, but in any case, not relevant I think.

The question about the command line: yes, that command line is one I was using, and definitely results in the error. As do the two vc calls I listed somewhere up there. (that is basically just the line from the vc config in any case, plus me mucking with the temp assignment.

Mac is a 2017 MacBook Pro, so yes to the x86 64 bit.

For the series of questions, I used the defaults each time.

compiler I used: didn't change the default, so it looks like 'gcc', but I think maybe on the mac that gcc is actually a link to LLVM. I saw some posts to that effect. I'm not sure how to verify that for my machine though. I have a gcc in /usr/bin, an it doesn't look like a link to llvm-gcc (to me). No arrow thingie.
--- (from my /usr/bin
-rwxr-xr-x 1 root wheel 18288 Jul 4 06:02 gcc

lrwxr-xr-x 1 root wheel 7 Jun 1 23:36 llvm-g++ -> clang++
lrwxr-xr-x 1 root wheel 5 Jun 1 23:36 llvm-gcc -> clang

---
Warty is offline  
Old 16 August 2018, 22:55   #12
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
(tried this as one post, but too long I think, so splitting. may have to edit out some of the build echos)


I am going to try the rebuild again, but in the meantime, this is the most recent build I did last night (err, I hope this isn't posting too much...):
--------------------
$ make TARGET=m68k
gcc -std=c9x -g -DHAVE_AOS4 frontend/vc.c -o bin/vc -lm
frontend/vc.c:222:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
{printf(nomem);raus(EXIT_FAILURE);}
^~~~~
frontend/vc.c:222:17: note: treat the string as an argument to avoid this
{printf(nomem);raus(EXIT_FAILURE);}
^
"%s",

<<SNIP>>


^
/usr/include/stdio.h:186:1: note: 'tmpnam' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you us...
^
/usr/include/sys/cdefs.h:180:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
^
20 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 vprof/vprof.c -o bin/vprof -lm
vprof/vprof.c:108:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (fp = fopen(mname,"r")) {
~~~^~~~~~~~~~~~~~~~~~
vprof/vprof.c:108:10: note: place parentheses around the assignment to silence this warning
if (fp = fopen(mname,"r")) {
^
( )
vprof/vprof.c:108:10: note: use '==' to turn this assignment into an equality comparison
if (fp = fopen(mname,"r")) {
^
==
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 datatypes/dtgen.c -o bin/dtgen -Idatatypes -lm
bin/dtgen machines/m68k/machine.dt machines/m68k/dt.h machines/m68k/dt.c
Are you building a cross-compiler?
Type y or n [y]: make TARGET=m68ks
Type y or n [y]: Type y or n [y]: Type y or n [y]:
Does your system/compiler support a type implemented as
standard 2-complement 8bit byte?
Type y or n [y]:
Enter that type[signed char]:
Does your system/compiler support a type implemented as
standard unsigned 8bit byte?
Type y or n [y]:
Enter that type[unsigned char]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 2-complement 16bit word, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 2-complement 16bit word, little-endian?
Type y or n [y]:
Enter that type[signed short]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based unsigned 16bit word, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based unsigned 16bit word, little-endian?
Type y or n [y]:
Enter that type[unsigned short]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 2-complement 32bit word, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 2-complement 32bit word, little-endian?
Type y or n [y]:
Enter that type[signed int]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based unsigned 32bit word, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based unsigned 32bit word, little-endian?
Type y or n [y]:
Enter that type[unsigned int]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 2-complement 64bit word, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 2-complement 64bit word, little-endian?
Type y or n [y]:
Enter that type[signed long]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based unsigned 64bit byte, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based unsigned 64bit byte, little-endian?
Type y or n [y]:
Enter that type[unsigned long]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 32bit IEEE floating-point, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 32bit IEEE floating-point, little-endian?
Type y or n [y]:
Enter that type[float]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 64bit IEEE floating-point, big-endian?
Type y or n [n]:
Does your system/compiler support a type implemented as
standard 8bit-byte-based 64bit IEEE floating-point, little-endian?
Type y or n [y]:
Enter that type[double]:
gcc -std=c9x -g -DHAVE_AOS4 -c opt.c -o machines/m68k/opt.o -Imachines/m68k

opt.c:62:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(libname=use_libcall(c,p->typf,p->typf2)){
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
opt.c:62:12: note: place parentheses around the assignment to silence this warning
if(libname=use_libcall(c,p->typf,p->typf2)){
^
( )
opt.c:62:12: note: use '==' to turn this assignment into an equality comparison
if(libname=use_libcall(c,p->typf,p->typf2)){
^
==
opt.c:360:47: warning: '/*' within block comment [-Wcomment]
/*bsize=(basic_blocks+CHAR_BIT-1)/CHAR_BIT; /* we don's use fg->index but count from 0 */
^

2 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c av.c -o machines/m68k/av.o -Imachines/m68k
av.c:109:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(v=fi->use_list[i].v) fi->use_list[i].v->index=-1;
~^~~~~~~~~~~~~~~~~~
av.c:109:10: note: place parentheses around the assignment to silence this warning
if(v=fi->use_list[i].v) fi->use_list[i].v->index=-1;
^
( )
av.c:109:10: note: use '==' to turn this assignment into an equality comparison
if(v=fi->use_list[i].v) fi->use_list[i].v->index=-1;
^
==
av.c:114:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(v=fi->change_list[i].v) fi->change_list[i].v->index=-1;
~^~~~~~~~~~~~~~~~~~~~~
av.c:114:10: note: place parentheses around the assignment to silence this warning
if(v=fi->change_list[i].v) fi->change_list[i].v->index=-1;
^
( )
av.c:114:10: note: use '==' to turn this assignment into an equality comparison
if(v=fi->change_list[i].v) fi->change_list[i].v->index=-1;
^
==

2 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c rd.c -o machines/m68k/rd.o -Imachines/m68k
rd.c:61:46: warning: '/*' within block comment [-Wcomment]
/*dsize=(2*dcount+1+CHAR_BIT)/CHAR_BIT; /* +1, da bei 1 anfaengt */
^

1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c regs.c -o machines/m68k/regs.o -Imachines/m68k

regs.c:844:7: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(v=find_const_var(o,t)){
~^~~~~~~~~~~~~~~~~~~~
regs.c:844:7: note: place parentheses around the assignment to silence this warning
if(v=find_const_var(o,t)){
^
( )
regs.c:844:7: note: use '==' to turn this assignment into an equality comparison
if(v=find_const_var(o,t)){
^
==
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c flow.c -o machines/m68k/flow.o -Imachines/m68k

gcc -std=c9x -g -DHAVE_AOS4 -c cse.c -o machines/m68k/cse.o -Imachines/m68k

gcc -std=c9x -g -DHAVE_AOS4 -c cp.c -o machines/m68k/cp.o -Imachines/m68k

cp.c:237:73: warning: '&&' within '||' [-Wlogical-op-parentheses]
...||!(p->q1.flags&DREFOBJ)&&(!static_cse||!((p->q1.flags&(VAR|VARADR))==VAR)||(p->q1.v->storage_class!=EXTERN&&p->q1.v->storage_class!=STATIC))){
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cp.c:237:73: note: place parentheses around the '&&' expression to silence this warning
...!(p->q1.flags&DREFOBJ)&&(!static_cse||!((p->q1.flags&(VAR|VARADR))==VAR)||(p->q1.v->storage_class!=EXTERN&&p->q1.v->storage_class!=STATIC))){
^
( )
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c loop.c -o machines/m68k/loop.o -Imachines/m68k

loop.c:1213:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
while(m=first_ur){
~^~~~~~~~~
loop.c:1213:10: note: place parentheses around the assignment to silence this warning
while(m=first_ur){
^
( )
loop.c:1213:10: note: use '==' to turn this assignment into an equality comparison
while(m=first_ur){
^
==
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c alias.c -o machines/m68k/alias.o -Imachines/m68k

alias.c:507:8: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(v=fi->change_list[i].v){
~^~~~~~~~~~~~~~~~~~~~~

<<SNIP>>

( )
alias.c:585:8: note: use '==' to turn this assignment into an equality comparison
if(v=fi->use_list[i].v){
^
==
2 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c main.c -o machines/m68k/main.o -Imachines/m68k

main.c:165:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (last = strchr(p,'.')) {
~~~~~^~~~~~~~~~~~~~~
main.c:165:12: note: place parentheses around the assignment to silence this warning
if (last = strchr(p,'.')) {
^

<<SNIP>>

^
( )
main.c:1806:9: note: use '==' to turn this assignment into an equality comparison
while(c=*p++)
^
==
11 warnings generated.

gcc -std=c9x -g -DHAVE_AOS4 -c vars.c -o machines/m68k/vars.o -Imachines/m68k
In file included from vars.c:80:
./misra_errors.h:2:73: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
1,1,"All code shall conform to ISO 9899:1990 \"Programming languages - C<E2>\", amended and "
^~~~
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c declaration.c -o machines/m68k/declaration.o -Imachines/m68k

declaration.c:835:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(d=get_string()){
~^~~~~~~~~~~~~

<<SNIP>>

^
==
declaration.c:1824:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^

5 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c parse_expr.c -o machines/m68k/parse_expr.o -Imachines/m68k

gcc -std=c9x -g -DHAVE_AOS4 -c type_expr.c -o machines/m68k/type_expr.o -Imachines/m68k

type_expr.c:513:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(v=find_ext_var(p->left->identifier)){
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type_expr.c:513:9: note: place parentheses around the assignment to silence this warning
if(v=find_ext_var(p->left->identifier)){
^
( )
type_expr.c:513:9: note: use '==' to turn this assignment into an equality comparison
if(v=find_ext_var(p->left->identifier)){
^
==
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c ic.c -o machines/m68k/ic.o -Imachines/m68k

ic.c:54:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(libname=use_libcall_wrap(TEST,t,0)){
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ic.c:54:15: note: place parentheses around the assignment to silence this warning
if(libname=use_libcall_wrap(TEST,t,0)){
^
( )
ic.c:54:15: note: use '==' to turn this assignment into an equality comparison
if(libname=use_libcall_wrap(TEST,t,0)){
^
==
ic.c:674:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(libname=use_libcall_wrap(p->flags,p->ntyp->flags,0)){
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<<SNIP>>

^
==

7 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c machines/m68k/machine.c -o machines/m68k/machine.o -Imachines/m68k -I.
machines/m68k/machine.c:342:32: warning: '&&' within '||' [-Wlogical-op-parentheses]
if(r==u||(reg_pair(u,&rp)&&r==rp.r1||r==rp.r2)){
~~~~~~~~~~~~~~~^~~~~~~~~~~~
machines/m68k/machine.c:342:32: note: place parentheses around the '&&' expression to silence this warning
if(r==u||(reg_pair(u,&rp)&&r==rp.r1||r==rp.r2)){
^
( )
machines/m68k/machine.c:400:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
<<SNIP>>

^
( )
machines/m68k/machine.c:4865:9: note: use '==' to turn this assignment into an equality comparison
if(ln=pof2(vumax)){
^
==
machines/m68k/machine.c:5155:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^


8 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c statements.c -o machines/m68k/statements.o -Imachines/m68k

statements.c:568:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(tvalid=type_expression(tree,0)){
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
statements.c:568:14: note: place parentheses around the assignment to silence this warning
if(tvalid=type_expression(tree,0)){
^
( )
statements.c:568:14: note: use '==' to turn this assignment into an equality comparison
if(tvalid=type_expression(tree,0)){
^
==
statements.c:744:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(tvalid=type_expression(tree2,0)){
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
statements.c:744:14: note: place parentheses around the assignment to silence this warning
if(tvalid=type_expression(tree2,0)){
^
( )
statements.c:744:14: note: use '==' to turn this assignment into an equality comparison
if(tvalid=type_expression(tree2,0)){
^
==
statements.c:1036:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(v=find_var(tree->left->identifier,0)){
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
statements.c:1036:9: note: place parentheses around the assignment to silence this warning
if(v=find_var(tree->left->identifier,0)){
^
( )
statements.c:1036:9: note: use '==' to turn this assignment into an equality comparison
if(v=find_var(tree->left->identifier,0)){
^
==
statements.c:1058:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(tree=expression()){
~~~~^~~~~~~~~~~~~
statements.c:1058:12: note: place parentheses around the assignment to silence this warning
if(tree=expression()){
^
( )
statements.c:1058:12: note: use '==' to turn this assignment into an equality comparison
if(tree=expression()){
^
==
statements.c:1168:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if(tree=expression()){
~~~~^~~~~~~~~~~~~
statements.c:1168:10: note: place parentheses around the assignment to silence this warning
if(tree=expression()){
^
( )
statements.c:1168:10: note: use '==' to turn this assignment into an equality comparison
if(tree=expression()){
^
==
5 warnings generated.
gcc -std=c9x -g -DHAVE_AOS4 -c supp.c -o machines/m68k/supp.o -Imachines/m68k

supp.c:1564:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
while (c = (unsigned char)*name++)
~~^~~~~~~~~~~~~~~~~~~~~~~~
supp.c:1564:12: note: place parentheses around the assignment to silence this warning
while (c = (unsigned char)*name++)
^
( )
supp.c:1564:12: note: use '==' to turn this assignment into an equality comparison
while (c = (unsigned char)*name++)
^
==
1 warning generated.
gcc -std=c9x -g -DHAVE_AOS4 -c machines/m68k/dt.c -o machines/m68k/dt.o -Imachines/m68k -Idatatypes

gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/assert.c -o machines/m68k/assert.o -Imachines/m68k
gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/cpp.c -o machines/m68k/cpp.o -Imachines/m68k

ucpp/cpp.c:634:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (f = fopen(s ? s : name, "r")) {
~~^~~~~~~~~~~~~~~~~~~~~~~~~~
ucpp/cpp.c:634:10: note: place parentheses around the assignment to silence this warning
if (f = fopen(s ? s : name, "r")) {
^
( )
ucpp/cpp.c:634:10: note: use '==' to turn this assignment into an equality comparison
if (f = fopen(s ? s : name, "r")) {
^
==
1 warning generated.

gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/hash.c -o machines/m68k/hash.o -Imachines/m68k
gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/lexer.c -o machines/m68k/lexer.o -Imachines/m68k

gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/macro.c -o machines/m68k/macro.o -Imachines/m68k

gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/mem.c -o machines/m68k/mem.o -Imachines/m68k

gcc -std=c9x -g -DHAVE_AOS4 -DNO_UCPP_ERROR_FUNCTIONS -c ucpp/eval.c -o machines/m68k/eval.o -Imachines/m68k
gcc -std=c9x -g -DHAVE_AOS4 -lm machines/m68k/opt.o machines/m68k/av.o machines/m68k/rd.o machines/m68k/regs.o machines/m68k/flow.o machines/m68k/cse.o machines/m68k/cp.o machines/m68k/loop.o machines/m68k/alias.o machines/m68k/main.o machines/m68k/vars.o machines/m68k/declaration.o machines/m68k/parse_expr.o machines/m68k/type_expr.o machines/m68k/ic.o machines/m68k/machine.o machines/m68k/statements.o machines/m68k/supp.o machines/m68k/dt.o machines/m68k/assert.o machines/m68k/cpp.o machines/m68k/hash.o machines/m68k/lexer.o machines/m68k/macro.o machines/m68k/mem.o machines/m68k/eval.o -o bin/vbccm68k
Warty is offline  
Old 18 August 2018, 00:11   #13
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
Ok, a little more information:
1. I deleted as described, and did make again.
2. I checked the y/n answers for the endian questions, they seemed correct to me.
3. I checked the re-generated DT files, and they were identical before and after.
4. The binaries generated also appeared to be identical. (I just compared byte size and usage results though).
5. doing --version on gcc produces this:
----
xxxxxx$ /usr/bin/gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
------

Is the LLVM a problem? Any suggestions at this point?
Warty is offline  
Old 18 August 2018, 09:11   #14
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Try this, it's my own finished and working installation for macOS, minus the binaries.

Change the extension to .tar.xz (because of EAB's bad file upload rules) and extract, build the binaries and place in vbcc/bin, create $VBCC and point it to vbcc/, and add vbcc/bin to your path.
Attached Files
File Type: zip vbcc.zip (2.05 MB, 106 views)
Leffmann is offline  
Old 18 August 2018, 15:22   #15
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
Thanks Leffmann. I dumped my old /opt/vbcc/ directory and set up yours, then put the binaries in. Same results though.
---
xxxxxxxxx$ vc +kick13 hello.c
>
warning 278 in line -1 of "hello.c": void macro name
----
Warty is offline  
Old 18 August 2018, 15:29   #16
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
No idea then... the only thing I do different is to remove
-DHAVE_AOS4
from the vbcc makefile.
Leffmann is offline  
Old 18 August 2018, 15:51   #17
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Leffmann's headers and config files don't help, because the problem is in the vbcc binary.

I have no idea what went wrong. I studied the build logs and all seems normal. The warnings are harmless. The data types are correct.

It is either caused by LLVM or its settings. Does it use a strange char-type or encoding? Is "char" signed or unsigned? Can you switch to GCC or a different compiler somehow?

@Leffmann: Did you also build vbcc with LLVM? Which version? Maybe you can provide your "vbccm68k" binary for testing?


Otherwise, if you are really desparate and willing to find the problem: I saw that you compiled vbccm68k with source level debugging (-g) and without optimization. You could try to debug this strange macro definition, if you have a working GDB or similar. For example, set a break point at "define_macro":

Code:
frank@altair gdb /usr/local/vbcc/bin/vbccm68k
GNU gdb (GDB) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
(...)
Reading symbols from /usr/local/vbcc/bin/vbccm68k...done.
(gdb) b define_macro 
Breakpoint 1 at 0x18a7b08: file ucpp/macro.c, line 1632.
(gdb) r -hunkdebug "nada.c" -o= "tmp0.asm" -c99 -O=1 -no-cpp-warn -I/opt/vbcc/targets/m68k-kick13/include/
Starting program: /usr/local/vbcc/bin/vbccm68k -hunkdebug "nada.c" -o= "tmp0.asm" -c99 -O=1 -no-cpp-warn -I/opt/vbcc/targets/m68k-kick13/include/
vbcc V0.9f (c) in 1995-2017 by Volker Barthelmann
vbcc code-generator for m68k/ColdFire V1.12 (c) in 1995-2017 by Volker Barthelmann

Breakpoint 1, define_macro (ls=0x18e30fc <ls>, 
    def=0x18b9600 "__section(x)=__vattr(\"section(\"#x\")\")")
    at ucpp/macro.c:1632
1632            char *c = sdup(def), *d;
(gdb)
"def" shows the macro definition on each breakpoint. This debugging session was on an iBook G4 running NetBSD, but should be similar.
EDIT: 'c' continues the program, until next break point.

Last edited by phx; 18 August 2018 at 15:56. Reason: 'c'
phx is offline  
Old 18 August 2018, 23:54   #18
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
I, I'm *definitely* that desperate.

This is what I get:
------
$ gdb /opt/vbcc/bin/vbccm68k
GNU gdb (GDB) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin17.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/vbcc/bin/vbccm68k...done.
(gdb) b define_macro
Breakpoint 1 at 0x10009c097: file ucpp/macro.c, line 1632.
(gdb) r -hunkdebug "nada.c" -o= "tmp0.asm" -c99 -O=1 -no-cpp-warn -I/opt/vbcc/targets/m68k-kick13/include/
Starting program: /opt/vbcc/bin/vbccm68k -hunkdebug "nada.c" -o= "tmp0.asm" -c99 -O=1 -no-cpp-warn -I/opt/vbcc/targets/m68k-kick13/include/
Unable to find Mach task port for process-id 10904: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
(gdb)
-------

I'm going to see if I can get a non-LLVM gcc installed too.
Warty is offline  
Old 19 August 2018, 00:10   #19
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Warty View Post
Unable to find Mach task port for process-id 10904: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
Maybe you have to "codesign" gdb to make it work? I have no experience with MacOS, but I found this: https://stackoverflow.com/questions/...ocess-id-error
phx is offline  
Old 19 August 2018, 00:41   #20
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I build with clang, with version string "Apple LLVM version 8.0.0 (clang-800.0.42.1)"

I've attached the binaries, if it's to any help.
Attached Files
File Type: zip vbcc.zip (849.0 KB, 116 views)
Leffmann is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a little help getting started... stevecole New to Emulation or Amiga scene 20 18 April 2009 21:30
Need help gettin started guybhoy New to Emulation or Amiga scene 12 16 February 2008 06:09
Getting started!! thequeenfan New to Emulation or Amiga scene 14 18 December 2003 23:46
Just getting started scot_pete New to Emulation or Amiga scene 6 24 June 2002 19:14
Getting started again The Shadow New to Emulation or Amiga scene 1 07 April 2002 22:42

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10301 seconds with 14 queries