I have an unusual situation: I have an assembler file, which has .c extension and I cannot change build scripts, where this file is defined as "C" type. However, I can build it with the same GCC options if I rename it into .asm or *.s.
Is there any standard method to make GCC to think an input file is Assembler even if it has .c extension?
I can't change build script! I can only change the .c file. So, maybe there is a way to set command-line option '-x assembler' using preprocessor?
This sounds a bit complicated, but if you use bash or anything similar you can alias gcc to a script you'll write and in this script when it gets the file you want to change behavior use the -x assembler
parameter with gcc and act normally in otherfiles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With