zoukankan      html  css  js  c++  java
  • 关于 implicit declaration of function Which should not record for myself

    用gcc编译c程序的时候 经常会出现
    implicit declaration of function '...' 的warning

    偶经过这几天的经验,发现主要有2种情况会产生这种warning

    1   没有把函数所在的c文件生成.o目标文件
    2   在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明

    第二种情况如此:

    camif_fsm.c中的函数定义:

    void camif_start_c_with_p(camif_cfg_t *cfg, camif_cfg_t *other)
    {
    // cfg->gc->other = get_camif(CODEC_MINOR);
    cfg->gc->other = other;
    camif_start_p_with_c(cfg);
    }

    该函数的声明未包含在camif.h文件中,这样在调用此函数时由于camif_start_p_with_c(cfg)函数的定义在此函数之前,故产生此错误:warning: implicit declaration of function `camif_start_c_with_p'


    So the problem is the include file should exist in .c and .h files...

  • 相关阅读:
    Mybatis懒加载
    Mybatis 动态SQL
    Mybatis的多表查询
    linux selinux
    linux find/vi复制粘贴
    01-oracle限定查询-20190404
    awk
    sed
    windows删除指定日期前的文件
    win10 sshsecureshellclient删除profile保存的信息
  • 原文地址:https://www.cnblogs.com/shaoguangleo/p/2805743.html
Copyright © 2011-2022 走看看