我正在创建一个 Chrome 扩展程序,用户应该能够在他们所在的任何网站上访问该扩展程序。我没有任何内容脚本,只有 popup.js 和 background.js。我是否需要像这样在清单 V3 中拥有主机权限?或者我可以省略 host_permissions 吗?
"host_permissions": [ "*://*/*" ]
这是我的代码片段:
#include <stdlib.h>
#include <stdio.h>
typedef struct node
{
char key; // value
struct node *next; // pointer to the next element
} Node;
int main(void)
{
Node *n = malloc(sizeof(Node));
n->key = 'K';
n->next = NULL;
free(n);
printf("%c\n", n->key);
}
Run Code Online (Sandbox Code Playgroud)
当上面的代码片段被编译并运行时......
ganningxu@Gannings-Computer:~/test$ gcc test_faults.c -o test_faults; ./test_faults
K
ganningxu@Gannings-Computer:~/test$ clang test_faults.c -o test_faults; ./test_faults
K
Run Code Online (Sandbox Code Playgroud)
访问释放的内存时,不会出现编译器警告或错误。有没有办法强制编译器显示此类错误?