[PATCH] s3: Remove check of constant condition in loop
Timur I. Bakeyev
timur at freebsd.org
Tue Mar 6 23:05:03 UTC 2018
Hi, Swen!
On 6 March 2018 at 11:46, Swen Schillig via samba-technical <
samba-technical at lists.samba.org> wrote:
> Please review ...and push.
>
Not sure which compiler did you use for testing, but Clang isn't happy with
nested function declaration:
+ bool (*str_eq)(const char *, const char *) = NULL;
+ bool strequal_cs(const char *s1, const char *s2)
+ { return (strcmp(s1, s2) == 0); }
+
+ str_eq = (conn->case_sensitive) ? strequal_cs : strequal;
And just refuses to compile. I had to move strequal_cs() outside the
function and declare it static:
+ static bool strequal_cs(const char *s1, const char *s2)
+ {
+ return (strcmp(s1, s2) == 0);
+ }
Please, consider such a change.
With best regards,
Timur Bakeyev.
More information about the samba-technical
mailing list