Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将 armcc/gcc 用于包含大型头文件(>20MB 硬件 CSR 文件)的代码库。我希望能够检测到包含这个大头文件的任何文件,因为我试图从根本上导致我的构建速度超慢。
我可以在其中一个编译器中使用一个选项来警告我文件的大小(包括它可能包含的头文件的大小)吗?
你可以把你的大头文件:
#warning This large header is included
然后在每个翻译单元中,您都会收到一条编译器 (GCC) 警告消息,指出包含该标头的源文件(直接或间接)。