首页 > 解决方案 > 通过 open(const char *filename, int flags[, mode_t mode]) 函数查找文件描述符返回的模式

问题描述

在编译带有-O1或更大标志的 C 程序时,编译器给出错误call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments

从互联网上搜索我发现 Open 必须需要通过mode_t选项O_CREATopen如何找到之前以 2 arg 函数返回的文件描述符的默认模式。

标签: ccompiler-optimization

解决方案


推荐阅读