My application has lots of warnings like shown below. Should I be trying to
remove these or are they typical of ATS application and to be ignored? Are
there some standard compiler flags that would turn off things that should
be ignored?
To take a particular case, the first error about const, I have the
following C declarations:
uint8_t packetIn[127];
const uint8_t *packetInCount = packetIn;
const uint8_t *packetInHeader = packetIn + 1;
The idea being there are some pointers into a block of data that never
change.
And, I assume arrayref does some kind of implicit cast and then there is a
warning. Note, I am not a C compiler expert, so I’m doing some guessing
here.
DATS/frames_dats.c: In function ‘process_smbus_frame_command_138’:
DATS/frames_dats.c:9714:1: warning: passing argument 1 of
‘ATSLIB_056_prelude__arrayref_get_at_gint__20__5’ discards ‘const’
qualifier from pointer target type [enabled by default]
ATSINSmove(tmp356,
ATSLIB_056_prelude__arrayref_get_at_gint__20__5(ATSPMVextval(packetInContents),
ATSPMVi0nt(0))) ;
^
DATS/frames_dats.c:861:1: note: expected ‘atstype_ptrk’ but argument is of
type ‘const uint8_t *’
ATSLIB_056_prelude__arrayref_get_at_gint__20__5(atstkind_type(atstype_ptrk),
atstkind_t0ype(atstype_int)) ;
^
patsopt -o DATS/main_dats.c.tmp -d DATS/main.dats
mv DATS/main_dats.c.tmp DATS/main_dats.c
avr-gcc -g -Wall -O2 -mmcu=atmega328p -DF_CPU=16000000UL -std=c99
-D_XOPEN_SOURCE -D_ATSTYPE_VAR_SIZE_=0X000F -D_ATS_CCOMP_EXCEPTION_NONE_
-D_ATS_CCOMP_RUNTIME_NONE_ -D_ATS_CCOMP_PRELUDE_NONE_
-D_ATS_CCOMP_PRELUDE_USER_="/home/mike/linti/libs/arduino-ats/avr_prelude/kernel_prelude.cats"
-Wno-unused-variable -Wno-unused-label -Wno-unused-but-set-variable -I.
-I/opt/ATS/ATS2-Postiats-0.2.4 -I/opt/ATS/ATS2-Postiats-0.2.4/ccomp/runtime
-I/home/mike/linti/libs/arduino-ats/_arduino
-I/home/mike/linti/libs/arduino-ats/_dummy
-I/home/mike/linti/libs/arduino-ats -c -o DATS/main_dats.o DATS/main_dats.c
DATS/main_dats.c:333:1: warning: ‘output_high_1’ defined but not used
[-Wunused-function]
output_high_1(atstkind_t0ype(atstype_int) arg0)
^
DATS/main_dats.c:363:1: warning: ‘input_2’ defined but not used
[-Wunused-function]
input_2(atstkind_t0ype(atstype_int) arg0)