^~~~
In file included from /opt/local/lib/gcc12/gcc/arm64-apple-darwin22/12.3.0/include-fixed/stdio.h:78,
from /PATHTOBART/bart/src/bart.c:11:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/_stdio.h:157:3: note: previous declaration of 'FILE' with type 'FILE'
157
} FILE;
^~~~
/PATHTOBART/bart/src/bart.c: In function 'parse_bart_opts':
/PATHTOBART/bart/src/bart.c:158:29: warning: passing argument 1 of 'print_usage' from incompatible pointer type [-Wincompatible-pointer-types]
158
/PATHTOBART/bart/src/misc/opts.h:177:31: note: expected 'FILE ' {aka 'struct _IO_FILE '} but argument is of type 'FILE *'
177
extern void print_usage(FILE fp, const char name, const char* usage_str, int n, const struct opt_s opts[n]);
~~^~
/PATHTOBART/bart/src/bart.c: In function 'bart_command':
/PATHTOBART/bart/src/bart.c:419:29: warning: assignment to 'FILE ' {aka 'struct _IO_FILE '} from incompatible pointer type 'FILE *' [-Wincompatible-pointer-types]
419
bart_output = fmemopen(buf, (size_t)len, "w");
^
/PATHTOBART/bart/src/bart.c:435:24: warning: passing argument 1 of 'fclose' from incompatible pointer type [-Wincompatible-pointer-types]
435
fclose(bart_output); // write final nul
^~~
FILE {aka struct _IO_FILE }
/opt/local/lib/gcc12/gcc/arm64-apple-darwin22/12.3.0/include-fixed/stdio.h:157:17: note: expected 'FILE ' but argument is of type 'FILE ' {aka 'struct _IO_FILE '}
157 | int fclose(FILE );
| ^~
make[1]: [/PATHTOBART/bart/src/bart.o] Error 1
make: [default] Error 2
Please note, I use gcc-mp-12 because I cannot install gcc10 using MacPorts - it results in an error. I otherwise follow the other installation instructions in the README using MacPorts. I am using an MacBook Pro with M1 (ARM-based) chip. I do not follow the ARM-based installation instructions (using HomeBrew), because I cannot install gcc-arm-embedded (this requires accessing armkeil.blob.core.windows.net which is a blocked domain in the UK due to suspected malicious activity or malware).
In commit f210544a58d4ad2f609fcfaf0fb1ef8845f16178, FILE is redefined in src/misc/opts.h as:
typedef struct _IO_FILE FILE;
When compiling with gcc-mp-12, this results in the following error:
Please note, I use gcc-mp-12 because I cannot install gcc10 using MacPorts - it results in an error. I otherwise follow the other installation instructions in the README using MacPorts. I am using an MacBook Pro with M1 (ARM-based) chip. I do not follow the ARM-based installation instructions (using HomeBrew), because I cannot install gcc-arm-embedded (this requires accessing armkeil.blob.core.windows.net which is a blocked domain in the UK due to suspected malicious activity or malware).