Original Works. reposted for the source! And keep the hyperlink!
The following error occurs when I recently used an older arm-Linux-GCC 4.1.2 to compile a newer Linux kernel:
Xxx. C: 1: Error: The program has a free '\ 357'
XXX: 1: Error: The program has a free '\ 273'
Xxx. C: 1: Error: The program has a free '\ 277'
This is because the file is stored in the form of a UTF-8 Bom, And the compiler used does not support this format.
Run the following command to check whether the XXX. c file is in UTF-8 BOM format:
$ Cat XXX. c | HD-N 10
The output is as follows:
00000000 ef bb bf 2f 2a 0a 20 2a 20 53 |.../*. * s |
0000000a
The first three codes of the output are ef bb bf, indicating that the file is in UTF-8 BOM format.
How to remove the UTF-8 BOM format?
Solution:
Download the bomstrip tool,
Download Page: http://www.ueber.net/who/mjl/projects/bomstrip/
Latest bomstrip-9: bomstrip-9.tgz
Installation and usage (in ubuntu11.04 ):,
Sudo apt-Get install ocaml
Tar zxvf bomstrip-9.tgz
CD bomstrip-9/
Sudo CP bomstrip. ocaml/usr/bin/
Sudo chmod 777/usr/bin/bomstrip. ocaml
Usage:
Ocaml/usr/bin/bomstrip. ocaml <input_file.c> output_file.c
Input_file.c is the original UTF-8 BOM format file, output_file.c is to remove the UTF-8 BOM format file.
Other Instructions:
Ocaml isOcaml language parser;
The bomstrip. ocaml file isThe bomstrip-9 is written in the ocaml language, among which there are other language scripts, I did not test one by one;
Bomstrip usage, how to use bomstrip, UTF-8 BOM error Solution