Why are C macros not type-safe?

后端 未结 7 1772
礼貌的吻别
礼貌的吻别 2021-02-18 16:01

If have encountered this claim multiple times and can\'t figure out what it is supposed to mean. Since the resulting code is compiled using a regular C compiler it will end up b

7条回答
  •  余生分开走
    2021-02-18 16:12

    When the macro runs, it just does a text match through your source files. This is before any compilation, so it is not aware of the datatypes of anything it changes.

提交回复
热议问题