Re: [gdm-list] [PATCH] fix gcc warnings



Ludwig:

[reply moved here because I think you are referring to the patch in
this thread]

Brian Cameron wrote:
Ludwig Nussel wrote:
Brian Cameron wrote:
Anyway, I did not apply a few of your changes to daemon/verify-pam.c
since they caused warnings to show up in Solaris.  If you want to
rework that patch so that the current code is surrounded by

#ifdef __sun
...
#else
your code
#endif

Then I would accept it, so it works on Solaris and Linux.
Which parts? I don't have Solaris so I can't check myself.
Your previous patch only had five 1-2 line modifications.  The
existing code should go in the #ifdef __sun section, your modification
should go in the else.  I will test your patch on Solaris if you
send it to me.

I assume you are referring to the following patch. If that causes
warnings on Solaris then the prototypes for conversation function
and pam_set_item must be different. On Linux it's

Yes, I was referring to the changes in daemon/verify-pam.c and yes
the conversion function definition is different on Solaris and Linux.

int (*conv)(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr);
int pam_get_item(const pam_handle_t *pamh, int item_type, const void **item);

Here are the definitions in Solaris /usr/include/security/pam_appl.h. Note the minor differences:

struct pam_conv {
        int (*conv)(int, struct pam_message **,
            struct pam_response **, void *);
        void *appdata_ptr;              /* Application data ptr */
};

extern int
pam_get_item(
        const pam_handle_t *pamh,       /* PAM handle */
        int item_type,                  /* Type of object - see below */
void ** item /* Address of place to put pointer */
                                        /*   to object */
);

I'd rather live with the warnings on either platform instead of
adding ugly #ifdefs

I'm happy to add #ifdef's if anybody on Linux wants the warnings to go away. Or if someone has a better idea of how to make the code compile
without warnings on all platforms.

I don't think warnings about a missing "const" would cause any
problems on any platform, though.

Brian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]