An error occurred while compiling insight in Ubuntu: Maid: warningsbeingtreatedaserrors .. /. /gdb/cli/cli-cmds.c: Infunction 'pwd _ command ':.. /. /gdb/cli/cli-cmds.c: 323: error: ignoringreturnvalueof 'getcwd ', declaredwithattri
An error occurred while compiling insight in Ubuntu:
C0: warnings being treated as errors
.././Gdb/cli/cli-cmds.c: In function 'pwd _ command ':
.././Gdb/cli/cli-cmds.c: 323: error: ignoring return value of 'getcwd ', declared with attribute warn_unused_result
Make [2]: *** [cli-cmds.o] Error 1
Make [2]: leaving the directory '/home/qiang/tools/insight-6.8-1/gdb'
Make [1]: *** [all-gdb] Error 2
Make [1]: Leaving directory '/home/qiang/tools/insight-6.8-1'
Make: *** [all] Error 2
Solution:
Method 1. Modify the source code,
Linux-nat.c: 2879: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
Old Code
Fgets (buffer, MAXPATHLEN, procfile );
The solution is:
Char * temp_p = fgets (buffer, MAXPATHLEN, procfile );
There are several other similar problems, basically all of which are gdb problems. Just solve them as needed, so I will not talk about them one by one.
Method 2: Go to the insight-6.8-1/gdb directory and open the Makefile file to search for-Werror
Old Code
WERROR_CFLAGS =-Werror
New Code
WERROR_CFLAGS = #-Werror
Both methods can be compiled to use insight.