buildworld doesn't like -O2
Stefan Farfeleder
stefan at fafoe.narf.at
Thu Dec 11 05:51:34 PST 2003
On Thu, Dec 11, 2003 at 02:25:08PM +0100, Dag-Erling Smørgrav wrote:
> andy at splashground.de writes:
> > And in this case, as far as i can see, the code does violate the
> > strict aliasing rules.
>
> Yes, and you are welcome to send a patch, but there was none in the
> PR. PRs consisting of nothing but a compiler error message are worse
> than useless.
A trivial yet unbeautiful one is attached.
Stefan
-------------- next part --------------
--- src/lib/libpam/modules/pam_echo/pam_echo.c.orig Thu Dec 11 14:44:36 2003
+++ src/lib/libpam/modules/pam_echo/pam_echo.c Thu Dec 11 14:46:24 2003
@@ -49,6 +49,7 @@
{
char msg[PAM_MAX_MSG_SIZE];
const char *str, *p, *q;
+ const void *r;
int err, i, item;
size_t len;
@@ -89,7 +90,9 @@
}
if (item == -1)
continue;
- err = pam_get_item(pamh, item, (const void **)&str);
+ r = str;
+ err = pam_get_item(pamh, item, &r);
+ str = r;
if (err != PAM_SUCCESS)
return (err);
if (str == NULL)
More information about the freebsd-current
mailing list