trying to link with libhal fails with -Wshadow

Bug #29692 reported by j^
24
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Invalid
Low
Martin Pitt

Bug Description

trying to compile NetworkManager cvs it fails with:
/usr/include/hal/libhal.h:306: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here

this is due to -Wshadow

libhal should not shadow a global declaration.

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 29692] trying to link with libhal fails with -Wshadow

 assignee <email address hidden>
 status confirmed
 priority high

Changed in hal:
assignee: nobody → pitti
status: Unconfirmed → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

I checked this, and this only affects

struct LibHalPropertySetIterator_s {
        LibHalPropertySet *set; /**< Property set we are iterating over */
        unsigned int index; /**< Index into current element */
        LibHalProperty *cur_prop; /**< Current property being visited */
        void *reservered0; /**< Reserved for future use */
        void *reservered1; /**< Reserved for future use */
};

However, I don't want to change the API of hal just because of this. Is that still an issue? Ubuntu's network-manager compiles fine, and it's just a warning anyway.

Changed in hal:
status: Confirmed → Needs Info
Revision history for this message
Martin Pitt (pitti) wrote :

I'm closing this since I do not see how this can be an issue. It should be clear from the source code context whether the struct member or the global function is meant. Please reopen this bug if it actually causes any failure.

Changed in hal:
status: Needs Info → Rejected
Revision history for this message
Eli Criffield (launchpad-zendo) wrote :

It causes a failure in compiling the current cvs of NetworkManager, althought you can get it to compile by removing -Wshadow from configure.in.

The error is as reported in bug #37355 a dupplicate of this bug. (my bad for not searching finding this bug first).

Eli

Revision history for this message
c7d2f5c8667d26fffd5e7772d632c76d (c7d2f5c8667d26fffd5e7772d632c76d-deactivatedaccount) wrote :

Can this please be reopened? It's clearly a problem, since it already has 2 dups (bug 37355 and bug 37202)...

Martin Pitt (pitti)
Changed in hal:
status: Rejected → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

I refuse to regard this as a hal bug and break the HAL API because of this. A struct member should be allowed to have an arbitrary name. If network-manager CVS HEAD does not build, then this is a bug in network-manager CVS HEAD, not in hal. Since it does not affect the network-manager we ship, I reject this.

Changed in hal:
status: Confirmed → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.