* [PATCH] Remove C++ style comments from string3.h
@ 2016-09-29 21:13 Adhemerval Zanella
2016-09-30 0:08 ` Siddhesh Poyarekar
2016-09-30 10:17 ` Florian Weimer
0 siblings, 2 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2016-09-29 21:13 UTC (permalink / raw)
To: libc-alpha
The new check-installed-headers rule check now complains with C++
comment from string3.h with:
../string/bits/string3.h:129:1: error: C++ style comments are not allowed in ISO C90
// XXX We have no corresponding builtin yet.
Let use old C style comment to make compiler happy in old modes.
Tested on x86_64.
* string/bits/string3.h: Remove C++ style comments.
---
ChangeLog | 4 ++++
string/bits/string3.h | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/string/bits/string3.h b/string/bits/string3.h
index dd8db68..8f13b65 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -126,7 +126,7 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
}
-// XXX We have no corresponding builtin yet.
+/* XXX We have no corresponding builtin yet. */
extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
size_t __destlen) __THROW;
extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove C++ style comments from string3.h
2016-09-29 21:13 [PATCH] Remove C++ style comments from string3.h Adhemerval Zanella
@ 2016-09-30 0:08 ` Siddhesh Poyarekar
2016-09-30 10:17 ` Florian Weimer
1 sibling, 0 replies; 4+ messages in thread
From: Siddhesh Poyarekar @ 2016-09-30 0:08 UTC (permalink / raw)
To: Adhemerval Zanella, libc-alpha
On Thursday 29 September 2016 02:12 PM, Adhemerval Zanella wrote:
> The new check-installed-headers rule check now complains with C++
> comment from string3.h with:
>
> ../string/bits/string3.h:129:1: error: C++ style comments are not allowed in ISO C90
> // XXX We have no corresponding builtin yet.
>
> Let use old C style comment to make compiler happy in old modes.
>
> Tested on x86_64.
>
> * string/bits/string3.h: Remove C++ style comments.
LGTM.
Siddhesh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove C++ style comments from string3.h
2016-09-29 21:13 [PATCH] Remove C++ style comments from string3.h Adhemerval Zanella
2016-09-30 0:08 ` Siddhesh Poyarekar
@ 2016-09-30 10:17 ` Florian Weimer
2016-09-30 16:42 ` Adhemerval Zanella
1 sibling, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2016-09-30 10:17 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: libc-alpha
* Adhemerval Zanella:
> -// XXX We have no corresponding builtin yet.
> +/* XXX We have no corresponding builtin yet. */
> extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
> size_t __destlen) __THROW;
> extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
I think the comment is outdated, because such a builtin exists now:
/tmp/t.c:3:22: note: expected ‘char *’ but argument is of type ‘int’
/tmp/t.c:3:25: warning: passing argument 2 of ‘__builtin_stpncpy’ makes pointer from integer without a cast
__builtin_stpncpy (1, 2, 3);
^
This is with gcc version 4.9.2 (Debian 4.9.2-10).
Perhaps remove it and file a bug to clean this up?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove C++ style comments from string3.h
2016-09-30 10:17 ` Florian Weimer
@ 2016-09-30 16:42 ` Adhemerval Zanella
0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2016-09-30 16:42 UTC (permalink / raw)
To: Florian Weimer; +Cc: libc-alpha
On 30/09/2016 03:17, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> -// XXX We have no corresponding builtin yet.
>> +/* XXX We have no corresponding builtin yet. */
>> extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
>> size_t __destlen) __THROW;
>> extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
>
> I think the comment is outdated, because such a builtin exists now:
>
> /tmp/t.c:3:22: note: expected âchar *â but argument is of type âintâ
> /tmp/t.c:3:25: warning: passing argument 2 of â__builtin_stpncpyâ makes pointer from integer without a cast
> __builtin_stpncpy (1, 2, 3);
> ^
> This is with gcc version 4.9.2 (Debian 4.9.2-10).
>
> Perhaps remove it and file a bug to clean this up?
>
Good catch, bug report created [1]. I will work on it.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=20661
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-30 16:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 21:13 [PATCH] Remove C++ style comments from string3.h Adhemerval Zanella
2016-09-30 0:08 ` Siddhesh Poyarekar
2016-09-30 10:17 ` Florian Weimer
2016-09-30 16:42 ` Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).