- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在为一个项目使用 utarray(uthash library 的一部分)。每当我包含它时,我都会收到以下错误:
utarray.h:221:3: error: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]
不可否认,我在编译时使用了一些非常激进的标志(-Wall -Wpedantic -Wextra -Werror -pedantic-errors -std=c99
),但我不明白为什么这应该是一个完全错误。 strdup
在 string.h
中定义(根据 man strdup
),它非常清楚地包含在 utarray.h
中.
我做错了什么?谷歌没有帮助。 (显然没有其他人试图用这些标志编译 utarray.h
?)
这是一个无法编译的示例文件(使用 gcc -Wall -Wpedantic -Wextra -Werror -pedantic-errors -std=c99 scratch.c
)。
#include "utarray.h"
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
return 0;
}
版本:gcc 4.9.2、glibc 2.21、uthash 1.9.9
最佳答案
问题是 strdup()
不是 c 标准函数,它是 POSIX函数,你不能在使用strdup()
时使用-std=c99
,除非你在编译中添加以下-D_POSIX_C_SOURCE=200809L
命令
gcc -Wall -Wpedantic -Wextra -Werror -pedantic-errors -std=c99 -D_POSIX_C_SOURCE=200809L
关于c - utarray.h 中的 "implicit declaration of function"(uthash 的一部分),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28994015/
这是我的查询: INSERT INTO location_province(name, country) SELECT child.name ,location_country.id
尽管我看到 C++ 教程中广泛使用术语 implicit casting 来表示这样一个事实,即当您将某种类型分配给另一种类型时,类型的转换将自动(隐式)完成,但我经常听说应该叫implicit co
所有表格都在 utf_unicode_ci 中。 我这样做是为了检查 SELECT table_schema, table_name, column_name, character_set_name,
def MyFun(result: ListBuffer[(String, DateTime, List[(String, Int)])]): String = { val json = (r
我刚刚在 Postgres 中创建了一个表,并收到一条通知消息,我不完全理解隐式索引和序列。如有任何澄清,我们将不胜感激。 my_database=# CREATE TABLE sites my_da
我正在关注 Fernando Villalobos 的 React.js - A guide for Rails developers AirPair 教程。 这里的目标是使用 Rails 和 Rea
当我选择一个选项时,我有通过多选列表在 dbase 中搜索的代码我有这个错误: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (ut
我正在尝试使用 execl 调用来执行 kernel-space-driver (driver.c) 中的二进制文件此时(从第 850 行开始): if (!retval) {
我正在尝试在内核 3.13 上编译内核模块,但出现此错误: error: implicit declaration of function 'create_proc_read_entry' [-Wer
我检查了数据库表,发现它在 latin1_swedish_ci 中,所以我将其更改为 utf8_general_ci 然后我将排序规则从 latin1_swedish_ci 更改到所有字段的 utf8
尝试通过 MySQL 中的存储过程进行选择时出现以下错误 Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_ge
我收到了这个错误; Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT)
我需要您帮助确定为什么会出现此错误 Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT
我收到了这个错误; Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT)
MySql 上的错误信息: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) fo
在我的删除服务器上执行 MySQL 中的存储过程时,如下所示: CREATE OR REPLACE PROCEDURE `SetNextPage`( IN `inRefNo` varchar(
我正在尝试为 Kali linux 2.0 安装我的 Alfa AWUS036ACH 适配器 我已经修复了之前的错误,但现在我被困在这里了。这是错误我正在接收。 os_dep/linux/rtw_an
我们正在使用以下存储过程,并且所有提到的表都使用“Collation = utf8_general_ci”,但我们仍然收到此错误: Error Code: 1267. Illegal mix of
我想让我的 User 表的 password 列在 mysql 中区分大小写。 表的说明如下: /*Table: mst_user*/ FIELD TYPE
我对这一切都很陌生,正在尝试在内核版本为 3.10.0-957.el7.x86_64 的虚拟机上编译程序。但我收到此错误: /home/../../../isr_demux.c: In functio
我是一名优秀的程序员,十分优秀!