How to run gcc4.1.2 and gcc 4.7.3

The project should compile it as gcc4.1.2 (the company server) and gcc 4.7.3+ (desktop Linux-system) and have some problems:
1. the gcc 4.1.2 has Wno-unused-resultand Wno-unused-but-set-variable. I tried to substitute the last two with Wno-unused, but still ignore the return value of the error of the built-in function function.
2. There is also no Wno-narrowingin gcc 4.1.2, is there anything else I can use?
What to do to make them happy?

+4
source share
1 answer

I suggest that you deal with the differences between the two versions in the makefile. You can determine the GCC version and enable additional warning options if the GCC version supports them. This will help when the company finally moves forward.

It is worth fixing the code, but do not use warnings. This is what tells you about the problem in the first place (otherwise you would not have resolved them correctly?)

In any case, you can bypass unused warnings to system functions by discarding the result, which will be devoid of the compiler, you should ignore:

(void)builtin( ... );
+1
source

Source: https://habr.com/ru/post/1547099/


All Articles