In several places in this file GCC for ARM has compiler errors, but GCC for x86 compiles without error.
/home/ec2-user/ncbi/sra-tools/tools/copycat/ccsra.c:616:22: error: used struct type value where scalar is required
path_size = args ?
^
/home/ec2-user/ncbi/sra-tools/tools/copycat/ccsra.c: In function ‘CCNodeSraDirFileContiguous’:
The copycat tool won't attempt to build unless libmagic is installed (via the package file-devel). If you don't have that installed, you won't hit this error.
This code seems to be relying on undefined compiler behavior that is different with gcc x86 and gcc ARM.
The code is being clever and using the ternary operator to route between the vsnprintf and snprintf functions.
I think what's happening here is that in the x86 toolchain this aliases to a pointer, which can have zeroness. In the ARM toolchain, va_list seems to alias to a real struct, and therefore fails scalar tests.
It's not clear what this code is trying to do. It seems to be a safety valve where if no arguments are supplied, then the format string is emitted with the format terms still intact. In my testing I was not able to trigger this condition (i.e. vsnprintf was always invoked.)
I've attached a main_error.c which isolates this issue. It compiles and runs on a t3 (x86) instance, and fails to compile on a t4g (ARM) instance.
In several places in this file GCC for ARM has compiler errors, but GCC for x86 compiles without error.
The copycat tool won't attempt to build unless libmagic is installed (via the package file-devel). If you don't have that installed, you won't hit this error.
This code seems to be relying on undefined compiler behavior that is different with gcc x86 and gcc ARM.
The code is being clever and using the ternary operator to route between the vsnprintf and snprintf functions.
I think what's happening here is that in the x86 toolchain this aliases to a pointer, which can have zeroness. In the ARM toolchain, va_list seems to alias to a real struct, and therefore fails scalar tests.
It's not clear what this code is trying to do. It seems to be a safety valve where if no arguments are supplied, then the format string is emitted with the format terms still intact. In my testing I was not able to trigger this condition (i.e. vsnprintf was always invoked.)
I've attached a main_error.c which isolates this issue. It compiles and runs on a t3 (x86) instance, and fails to compile on a t4g (ARM) instance.
x86 GCC
ARM GCC
main_error.c.txt