解决vscode+clang+mingw64下的<float.h>兼容性问题
本人c语言纯萌新一枚,编程环境是vscode+clang+mingw,安装的时候是直接把mingw的文件无冲突合并到LLVM里的,参照: https://www.cnblogs.com/esllovesn/p/10012653.html 。 今日在完成c语言老师布置的作业的时候写了以下代码: #include<stdio.h> #include < float .h> int main( void ) { double dv = 1.0 / 3.0 ; float fv = 1.0 / 3.0 ; printf( " %.4f %.4f\n " , dv, fv); printf( " %.12f %.12f\n " , dv, fv); printf( " %.16f %.16f\n " , dv, fv); printf( " %d %d\n " , FLT_DIG, DBL_DIG); return 0; } 结果很意外的是,无论是直接插件run code还是F5编译均提示编译失败: In file included from exercises5.c: 2 : In file included from C:\Program Files\LLVM\lib\clang\ 9.0 . 0 \include\ float .h: 31 : C:\Program Files