#6 processclock.h uses memset in header file but does not #include <string.h>

닫힘
dlack2 년 전을 오픈 · 1개의 코멘트
Daniel Lackmann 코멘트됨, 2 년 전

processclock.h uses memset in header file but does not #include if processclock.h is included before string.h compilation will fail

https://gogs.reru.org/GfA/libgfaservices/src/master/common/processclock.h#L112

in most cases string.h is already included earlier in projects therefore the compiler will not raise an error.

WORKING

#include <string.h>
#include "gfa/svc/common/processclock.h"

NOT WORKING

#include "gfa/svc/common/processclock.h"
#include <string.h>

/opt/GfA/TC_L44104_C493_QT57_V02/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/gfa/svc/common/processclock.h:112: error: ‘memset’ was not declared in this scope
memset(&m_sc[nClockIndex].tsStopclock, 0, sizeof(struct timespec));
                                                                 ^
processclock.h uses memset in header file but does not #include <stdio.h> if processclock.h is included before string.h compilation will fail https://gogs.reru.org/GfA/libgfaservices/src/master/common/processclock.h#L112 in most cases string.h is already included earlier in projects therefore the compiler will not raise an error. WORKING #include <string.h> #include "gfa/svc/common/processclock.h" NOT WORKING #include "gfa/svc/common/processclock.h" #include <string.h> /opt/GfA/TC_L44104_C493_QT57_V02/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/gfa/svc/common/processclock.h:112: error: ‘memset’ was not declared in this scope memset(&m_sc[nClockIndex].tsStopclock, 0, sizeof(struct timespec)); ^
Hermann Rind 코멘트됨, 2 년 전
소유자

Header eingebunden.

Header eingebunden.
dlack 2 년 전가 Close
로그인하여 이 대화에 참여
레이블 없음
마일스톤 없음
담당자 없음
참여자 2명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.