Re: Fix Sparse Warnings for server/
Robert Shearman <rob(a)codeweavers.com> writes:
Changelog: Fix sparse warnings.
sparse should be taught that 0 is a perfectly fine value (and IMO preferable to NULL) for handles. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard wrote:
Robert Shearman <rob(a)codeweavers.com> writes:
Changelog: Fix sparse warnings.
sparse should be taught that 0 is a perfectly fine value (and IMO Linus wont agree to that. I didn't ask him but seen some of his posts to lklm regarding this matter.
preferable to NULL) for handles. Rob, I already talked to Alexandre about this at the Wineconf; that's why i didn't send in such a patch.
bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 Sr. Network Engineer Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani(a)redhat.com Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart
Alexandre Julliard wrote:
Robert Shearman <rob(a)codeweavers.com> writes:
Changelog: Fix sparse warnings.
sparse should be taught that 0 is a perfectly fine value (and IMO preferable to NULL) for handles.
I don't really understand this reasoning. Should gcc also be taught not to warn when we try to assign -1 to a handle? Are we using the wrong type for usr_handle_t then? Rob
Robert Shearman <rob(a)codeweavers.com> writes:
Alexandre Julliard wrote:
sparse should be taught that 0 is a perfectly fine value (and IMO preferable to NULL) for handles.
I don't really understand this reasoning. Should gcc also be taught not to warn when we try to assign -1 to a handle? Are we using the wrong type for usr_handle_t then?
In a sense, yes. Handles are conceptually much closer to integers than pointers, but they are pointers in the Windows API so that the different handles can have distinct types. It's really just a workaround for the fact that all integer types are freely interchangeable in C. -- Alexandre Julliard julliard(a)winehq.org
participants (3)
-
Alexandre Julliard -
Michael Stefaniuc -
Robert Shearman