Default flags for gcc compiler in Eclipse

前端 未结 5 431
孤城傲影
孤城傲影 2020-12-21 04:54

I want all my C programs to be compiled with the options -Wall -pedantic -ansi by default. Is there a way to have Eclipse add these flags to the compiler comman

5条回答
  •  忘掉有多难
    2020-12-21 05:34

    EDIT: I see that the OP runs Windows from a prior comment, however the following information may benefit users of Eclipse on the Linux platform, if Eclipse honors the alias.


    Are you running Eclipse in Linux? If so, try aliasing the gcc command; run this at a terminal:

    alias gcc='gcc -Wall -pedantic -ansi'
    

    This is a common method in Linux to specify default parameters for an application. However, Eclipse might execute the actual gcc application and ignore the alias; I have not tested it.

提交回复
热议问题