AVR atmega - warning: integer overflow in expression err
AVR - studio
AVR(atmega) compile err
warning: integer overflow in expression
ex) #define AT24C512_TOTAL_SIZE (32*1024) <<== err
#define AT24C512_TOTAL_SIZE (32*1024L) <== o.k.
AVR - studio
AVR(atmega) compile err
warning: integer overflow in expression
ex) #define AT24C512_TOTAL_SIZE (32*1024) <<== err
#define AT24C512_TOTAL_SIZE (32*1024L) <== o.k.
sbrk.c:(.text._sbrk+0x18): undefined reference to `end'
수정전
/* Those numbers are used for malloc and sbrk functions */ PROVIDE ( _linker_memory_start = _sdata ); PROVIDE ( _linker_heap_start = _ebss ); PROVIDE ( _linker_heap_end = (_estack - _Min_Stack_Size) ); PROVIDE ( _linker_memory_end = _estack ); PROVIDE ( _end = _ebss ); |
/* Those numbers are used for malloc and sbrk functions */
PROVIDE ( _linker_memory_start = _sdata );
PROVIDE ( _linker_heap_start = _ebss );
PROVIDE ( _linker_heap_end = (_estack - _Min_Stack_Size) );
PROVIDE ( _linker_memory_end = _estack );
PROVIDE ( _end = _ebss );
PROVIDE (end = .);/* <<== sbrk.c undefined reference to `end' */ |
================= Compiler version ================= arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150303 (releas e) [ARM/embedded-4_9-branch revision 221220] Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ================= Compile ================= Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc COLLECT_LTO_WRAPPER=d:/arm/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper.exe Target: arm-none-eabi ... D:\ARM\xxxxxxxxx\inc\stm32f2xx_flash.h:301:65: error: expected ';', ',' or ' )' before 'Data' FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data); ^ |
임시 해결 : 사용하지 않으므로, 해당 함수 주석처리함.
gcc hex, bin file size 줄이기 (0) | 2016.09.09 |
---|---|
LinkerScript - stm32_flash.ld (0) | 2016.09.09 |
gcc - error: two or more data types in declaration specifiers (0) | 2016.09.09 |
startup_stm32f2xx.s - arm? gcc_ride7? (0) | 2016.09.09 |
프로그램 코드 라이브러리 작성시 고려사항 (0) | 2016.09.01 |
증상 : 64비트윈도우에서, GetProcAddress로 호출한 함수 오동작 및, 디버깅중 종료가 안되는 문제
작업관리자에서 강제종료도 안됨
원인 : GetProcAddress의 리턴값을 포인터로 다시 변환하여 발생.
멈추는 문제는 다른것이 원인인듯.
잘못된 코드
typedef BOOL(WINAPI *FUNC_RegisterTouchWindow)(HWND hwnd,ULONG ulFlags); BOOL RegisterTouchWindow(HWND hwnd,ULONG ulFlags) { BOOL ret=0;FUNC_RegisterTouchWindow *f;
f=(FUNC_RegisterTouchWindow*)User32_DLL_GetProcAddress("RegisterTouchWindow"); if(f) { ret=(*f)(hwnd,ulFlags); <<=== 여기서 바로 리턴됨. 에러. 종료안됨. 잘못된 호출 } else { printf(_T("ERR RegisterTouchWindow")); } return ret; } |
올바른 코드
typedef BOOL(WINAPI *FUNC_RegisterTouchWindow)(HWND hwnd,ULONG ulFlags); BOOL RegisterTouchWindow(HWND hwnd,ULONG ulFlags) { BOOL ret=0;FUNC_RegisterTouchWindow f;
f=(FUNC_RegisterTouchWindow)User32_DLL_GetProcAddress("RegisterTouchWindow"); if(f) { ret=f(hwnd,ulFlags); } else { printf(_T("ERR RegisterTouchWindow")); } return ret; } |
어쩌다 한번씩 GetProcAddress를 사용하다보니, 실수함.
..\xxx.h:3:21: error: conflicting declaration of 'long unsigned int xxx()' with 'C' linkage
arm 컴파일중, 확장자가 c인것들을 CPP로 변경하여 발생.
원래대로 확장자를 C로 변경하여, 해결됨.
임베디드용 io 라이브러리 설계 계획-io라이브러리로 추상화 했을때의 장단점 (0) | 2016.09.01 |
---|---|
C언어-itoa 성능테스트 (0) | 2016.08.31 |
arm-none-eabi-gcc: error: CreateProcess: No such file or directory (0) | 2016.08.30 |
arm-none-eabi? (0) | 2016.08.30 |
gcc include 디렉토리 (0) | 2016.08.30 |
arm-none-eabi-gcc: error: CreateProcess: No such file or directory
위 문제는 gcc가 내부적으로 cc1.exe을 호출하기 때문입니다.
gcc설치당시 설정된 경로 "../lib/gcc/arm-none-eabi/4.9.3/"에서 호출하기때문입니다.
d:/XXXX/bin/../lib/gcc/arm-none-eabi/4.9.3/cc1.exe -E -lang-asm -quiet -v -I D :\Source\Lib -I D:\Source\Lib\XXXX -imultilib armv6-m -iprefix d:\XXXX\bin\../ lib/gcc/arm-none-eabi/4.9.3/ -isysroot d:\XXXX\bin\../arm-none-eabi -D__USES_IN ITFINI__ -D CORTEX_M0 -D USE_STDPERIPH_DRIVER D:\Source\LAN-AUDIO/XXXX/startup_ XXXX.S -mthumb -mcpu=cortex-m0 -g -fworking-directory -O3 -fno-directives-only -o C:\DOCUME~1\a\LOCALS~1\Temp\ccwt5swb.s |
결론:
arm-none-eabi
bin
lib
Source
※arm-none-eabi, bin, lib 폴더는 Source폴더와 같이 있어야 한다.(변경불가)
C언어-itoa 성능테스트 (0) | 2016.08.31 |
---|---|
error: conflicting declaration of 'long unsigned int xxx()' with 'C' linkage (0) | 2016.08.30 |
arm-none-eabi? (0) | 2016.08.30 |
gcc include 디렉토리 (0) | 2016.08.30 |
하드웨어는 점점 빨라졌지만, 소프트웨어는 오히려 점점 느려졌다 (0) | 2016.08.16 |