Why would somebody use an #if 1 C preprocessor directive?

前端 未结 9 2083
谎友^
谎友^ 2020-12-10 01:42

I am looking through some C source code and I don\'t understand the following part

#if 1

   typedef u         


        
9条回答
  •  清歌不尽
    2020-12-10 02:25

    I put that in my code when I need to test different set of parameters. Usually my product will ship with different defaults than what I can work with in a debug environment, so I put the shipping defaults in a #if 1 and the debug defaults in the #else with a #warning to warn me it's being built with debug defaults.

提交回复
热议问题