C And C++ Coding Standards

后端 未结 6 1995
不思量自难忘°
不思量自难忘° 2021-01-18 00:00

What are best practices with regards to C and C++ coding standards? Should developers be allowed to willy-nilly mix them together. Are there any complications when linking

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 00:48

    If you have a function in C++ which calls a function in C which in turn calls another function in C++, and this later function throws an exception which should be caught by the first function, you can have problems unless you told the C compiler to enable generation of the exception handling tables.

    For gcc, this is the -fexceptions parameter, which is enabled by default for C++ but disabled by default for C.

提交回复
热议问题