AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
240 stars 141 forks source link

Suppress 'not referenced' warning #259

Closed simonjwright closed 6 years ago

simonjwright commented 6 years ago

I’m building using the project wizard, for Crazyflie, which compiles with -gnatwe, giving

Compiling: /Users/simon/adacore/Ada_Drivers_Library/arch/ARM/cortex_m/src/semihosting-filesystem.ads
[...]
    98.    overriding
    99.    function Root_Node
   100.      (This   : in out SHFS;
   101.       As     : String;
              |
        >>> warning: formal parameter "As" is not referenced

   102.       Handle : out Any_Node_Handle)
              |
        >>> warning: formal parameter "Handle" is not referenced

   103.       return Status_Code
   104.    is (Operation_Not_Permitted);
[...]
   174. end Semihosting.Filesystem;
 383 lines: No errors, 2 warnings (treated as errors)
gprbuild: *** compilation phase failed
Fabien-Chouteau commented 6 years ago

Hi Simon,

This is because of a new check in GNAT Community 2018.

A better fix for it is to create a body for the function and flag the parameters as unreferenced.
That's what I did in the community_2018 branch that is not yet merged : https://github.com/AdaCore/Ada_Drivers_Library/commit/dd0cbf3a2175ecbd16adeee6cd5b62bb5e7a0502

simonjwright commented 6 years ago

Fabien, OK, of course.

Aside -- the other changes on that branch don’t seem to have much to do with CE2018?

Fabien-Chouteau commented 6 years ago

Actually they do because we have ZFP runtimes for the micro:bit and HiFive1 that requires changes in Ada Drivers Library.

However, I will split the branch to have this fix integrated ASAP.