bugAVR Downloader/UploaDEr - Bugs: bug #54387, minor compiler warnings


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

bug #54387: minor compiler warnings

Submitted by:  Dave Braun <sk8nfool>
Submitted on:  Thu 26 Jul 2018 01:52:55 PM UTC  
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  sk8nfool
Open/Closed:  Open Release:  6.3
Programmer hardware:  N/A Device type:  N/A

Sat 28 Jul 2018 11:57:33 AM UTC, comment #2:

I'm confused. What is 0x18AD? The ELF package has a bunch of constants define for use in the e_machine field of the elf32 and elf64 headers. These are simple integers ranging from 0 (EM_NONE) to 247 (EM_BPF). These are set by whatever application creates the ELF formatted file. To my knowledge 0x18AD doesn't fit this definition!

There is a comment in the elf.h file suggesting using large random numbers for new architectures. But there is a definition for the 32 bit AVR architecture. Perhaps 0x18AD is left over from ancient history when the 32 bit AVR architecture was new? If that's the case then there is a need for two constants - the official value (185) and the unofficial value (0x18AD).

Dave Braun <sk8nfool>
Thu 26 Jul 2018 07:48:55 PM UTC, comment #1:

Frankly, I have no idea what is the definition for EM_AVR32 that could actually be found in AVR32 ELF files in the wild ... 0x18ad seems to have been historically used, but obviously never made it into any official state.

If there are any AVR32 users around, maybe they could comment on that.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Thu 26 Jul 2018 01:52:55 PM UTC, original submission:

Compiling version 6.3 from source on Ubuntu 18.04 reports a redefinition warning that seems to be currently benign but may cause problems in the future. The error is

gcc -DHAVE_CONFIG_H -I. -I.. -DCONFIG_DIR=\"/home/braun/loca/etc\" -Wall -Wno-pointer-sign -g -O2 -MT libavrdude_a-fileio.o -MD -MP -MF .deps/libavrdude_a-fileio.Tpo -c -o libavrdude_a-fileio.o `test -f 'fileio.c' || echo '../'`fileio.c
../fileio.c:37:0: warning: "EM_AVR32" redefined
#define EM_AVR32 0x18ad /* inofficial */

In file included from /usr/include/libelf.h:36:0,
from ../fileio.c:33:
/usr/include/elf.h:323:0: note: this is the location of the previous definition
#define EM_AVR32 185 /* Amtel 32-bit microprocessor */

At least a comment should be added explaining why the redefinition is needed. If the intent was to actually redefine the constant a "#undef" should precede the redefinition.

A second warning occurs stating that misleading indentation is present. The warning is

gcc -DHAVE_CONFIG_H -I. -I.. -DCONFIG_DIR=\"/home/braun/local/etc\" -Wall -Wno-pointer-sign -g -O2 -MT libavrdude
_a-avr.o -MD -MP -MF .deps/libavrdude_a-avr.Tpo -c -o libavrdude_a-avr.o `test -f 'avr.c' || echo '../'`avr.c
../avr.c: In function ‘avr_tpi_chip_erase’:
../avr.c:83:5: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
while (avr_tpi_poll_nvmbsy(pgm));
../avr.c:85:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while

err = pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0);

BTW - I created a ./build directory in which I performed the build steps.

Dave Braun <sk8nfool>


Attached Files
file #44628:  excerpt.log added by sk8nfool (1KiB - text/x-log - Excerpt form outut of "make")


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 sk8nfool (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-26 sk8nfool Attached File- => Added excerpt.log, #44628

    Back to the top

    Powered by Savane 3.4