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

 
 

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

Submitter:  Joerg Wunsch <joerg_wunsch>
Submitted:  Mon 21 Jun 2010 08:43:55 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Status:  Fixed
Assigned to:  joerg_wunsch Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group 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>
Group administrator
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>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

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 awachtler (Posted a comment)
  • -email is unavailable- added by joerg_wunsch (Submitted the item)
  •  

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-22 joerg_wunsch StatusNone Fixed
        Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code