bugAVR Downloader/UploaDEr - Bugs: bug #39794, warnings when building avrdude...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4

Submitter:  Galen Seitz <galens>
Submitted:  Fri 16 Aug 2013 04:34:34 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  joerg_wunsch Originator Name:  Galen Seitz
Open/Closed:  Closed Release:  None
Programmer hardware:  Device type: 

Mon 02 Sep 2013 08:31:06 PM UTC, comment #1: 

Fixed except of the format warnings about size_t.  As long
as we cannot be sure all target platforms support %z, it's
better to leave them as warnings.

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 16 Aug 2013 04:34:34 AM UTC, original submission:  

While building avrdude 6.0rc1 under CentOS 6.4, I encountered the following warnings.  I posted these to the avrdude-dev mailing list, and Joerg responded.  I have included some of Joerg's response.


gcc -DHAVE_CONFIG_H -I.  -DCONFIG_DIR=\"/usr/local/etc\"  -Wall -Wno-pointer-sign -g -O2 -MT libavrdude_a-avr.o -MD -MP -MF .deps/libavrdude_a-avr.Tpo -c -o lib avrdude_a-avr.o `test -f 'avr.c' || echo './'`avr.c
avr.c: In function 'avr_tpi_program_enable':
avr.c:131: warning: passing argument 2 of 'pgm->cmd_tpi' discards qualifiers from pointer target type
avr.c:131: note: expected 'unsigned char ' but argument is of type 'const unsigned char '

Joerg> This means argument 2 of the cmd_tpi method should be made expect a pointer to const.  Not a big deal, but a number of files have to be changed.


gcc -DHAVE_CONFIG_H -I.  -DCONFIG_DIR=\"/usr/local/etc\"  -Wall -Wno-pointer-sign -g -O2 -MT libavrdude_a-fileio.o -MD -MP -MF .deps/libavrdude_afileio.Tpo -c -o libavrdude_a-fileio.o `test -f 'fileio.c' || echo './'`fileio.c
fileio.c: In function 'elf2b':
fileio.c:947: warning: 'elf_getshstrndx' is deprecated (declared at /usr/include/libelf.h:281)

Joerg> I already changed that (replaced by elf_getshdrstrndx()).

fileio.c:967: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
fileio.c:1027: warning: cast from pointer to integer of different size
fileio.c:1027: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
fileio.c:1057: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

Joerg> That's difficult.  C99 declares a new printf() format for size_t ("z"), but last time we've been there, Cygwin didn't have it.


gcc -DHAVE_CONFIG_H -I.  -DCONFIG_DIR=\"/usr/local/etc\"  -Wall -Wno-pointer-sign -g -O2 -MT libavrdude_a-jtag3.o -MD -MP -MF .deps/libavrdude_a-jtag3.Tpo -c -o libavrdude_a-jtag3.o `test -f 'jtag3.c' || echo './'`jtag3.c
jtag3.c: In function 'jtag3_initialize':
jtag3.c:850: warning: 'flashsize' may be used uninitialized in this function

Joerg> Should not trigger in practice, but the compiler cannot know this.  (It would remain uninitialized indeed if someone created a config entry that has no "flash" section.)


gcc -DHAVE_CONFIG_H -I.  -DCONFIG_DIR=\"/usr/local/etc\"  -Wall -Wno-pointer-sign -g -O2 -MT libavrdude_a-pickit2.o -MD -MP -MF .deps/libavrdude_a-pickit2.Tpo -c -o libavrdude_a-pickit2.o `test -f 'pickit2.c' || echo './'`pickit2.c
pickit2.c: In function 'usb_open_device':
pickit2.c:1170: warning: cast from pointer to integer of different size

Joerg> It should probably print the pointer using the %p format.



Here are the versions of the compiler and two of the related libraries.
$ rpm -q gcc
gcc-4.4.7-3.el6.x86_64
$ rpm -q elfutils-libelf
elfutils-libelf-0.152-1.el6.x86_64
$ rpm -q libusb
libusb-0.1.12-23.el6.x86_64

Galen Seitz <galens>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by galens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-02 joerg_wunsch StatusNone Fixed
        Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code