bugµracoli - Bugs: bug #30194, warning: useless type name in...

 
 

bug #30194: warning: useless type name in empty declaration

Submitted by:  Joerg Wunsch <joerg_wunsch>
Submitted on:  Mon 21 Jun 2010 08:43:55 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Joerg Wunsch <joerg_wunsch>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 22 Jun 2010 07:04:41 AM UTC, comment #3:

A dummy module would be one option.

After understanding a bit better what it's supposed to do (I
didn't figure it out by the time I wrote the bugreport), I
think it's sufficient to just have

#if HIF_TYPE != HIF_NONE || defined DOXYGEN
void hif_init(const uint32_t baudrate);
#endif

in the header file. So, if someone calls hif_init() in the
HIF_NONE case, he'll catch the empty macro, while anyone
else sees the real prototype.

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Tue 22 Jun 2010 06:45:16 AM UTC, comment #2:

Yes, the define for hif_init is obviously garbage. What to do now?

The intention was that the application can still build, even
if it calls hif_init() but HIF_TYPE is HIF_NONE.

The political correct way seems to be adding a module hif_none.c, that contains empty functions for hif_init() and other hif_*.
that could eventually called.

Axel Wachtler <awachtler>
Project Administrator
Mon 21 Jun 2010 09:00:07 PM UTC, comment #1:

p.s.: This is for a tiny230 target board.

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Mon 21 Jun 2010 08:43:55 PM UTC, original submission:

In file included from /junk/AVR/uracoli/install/inc/ioutil.h:57,
from project.h:8,
from fb.c:4:
/junk/AVR/uracoli/install/inc/hif.h:74: warning: useless type name in empty declaration

This is due to:

#if HIF_TYPE != HIF_NONE || defined DOXYGEN
...
#else
# define hif_init(br)
...
#endif
...

void hif_init(const uint32_t baudrate);

Even if HIF_NONE is a pointless usage case, it should not
result in an empty definition inside the header file, which
eventually turns out to be:

void ;

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Jun 2010 07:12:08 PM UTCjoerg_wunschStatusNone=>Fixed
      Assigned toNone=>joerg_wunsch
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1