* Next question: sizeof(char buf[2042])
@ 2018-06-20 18:51 Bruce Korb
2018-06-20 18:52 ` Bruce Korb
2018-06-20 19:59 ` Marek Polacek
0 siblings, 2 replies; 3+ messages in thread
From: Bruce Korb @ 2018-06-20 18:51 UTC (permalink / raw)
To: GCC List
Yeah, I guess this is Clang, but is it a legal interpretation for Clang?
In file included from gnu-pw-mgr.c:24:
In file included from ./fwd.h:288:
*./seed.c:178:43: **warning: **sizeof on pointer operation will return size
of 'const char *' instead of 'const char [2042]'*
* [-Wsizeof-array-decay]*
char * tag = scribble_get(sizeof (tag_fmt) + strlen(OPT_ARG(TAG)));
* ^~~~~~~*
*It seems like a pretty brain damaged interpretation.*
--
- Bruce
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Next question: sizeof(char buf[2042])
2018-06-20 18:51 Next question: sizeof(char buf[2042]) Bruce Korb
@ 2018-06-20 18:52 ` Bruce Korb
2018-06-20 19:59 ` Marek Polacek
1 sibling, 0 replies; 3+ messages in thread
From: Bruce Korb @ 2018-06-20 18:52 UTC (permalink / raw)
To: GCC List
OK. My mistake. "Nevermind" -- side effect of another change.
On Wed, Jun 20, 2018 at 11:47 AM Bruce Korb <bruce.korb@gmail.com> wrote:
> Yeah, I guess this is Clang, but is it a legal interpretation for Clang?
>
> In file included from gnu-pw-mgr.c:24:
>
> In file included from ./fwd.h:288:
>
> *./seed.c:178:43: **warning: **sizeof on pointer operation will return
> size of 'const char *' instead of 'const char [2042]'*
>
> * [-Wsizeof-array-decay]*
>
> char * tag = scribble_get(sizeof (tag_fmt) + strlen(OPT_ARG(TAG)));
>
> * ^~~~~~~*
>
>
> *It seems like a pretty brain damaged interpretation.*
>
> --
> - Bruce
>
--
- Bruce
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Next question: sizeof(char buf[2042])
2018-06-20 18:51 Next question: sizeof(char buf[2042]) Bruce Korb
2018-06-20 18:52 ` Bruce Korb
@ 2018-06-20 19:59 ` Marek Polacek
1 sibling, 0 replies; 3+ messages in thread
From: Marek Polacek @ 2018-06-20 19:59 UTC (permalink / raw)
To: Bruce Korb; +Cc: GCC List
On Wed, Jun 20, 2018 at 11:47:45AM -0700, Bruce Korb wrote:
> Yeah, I guess this is Clang, but is it a legal interpretation for Clang?
>
> In file included from gnu-pw-mgr.c:24:
>
> In file included from ./fwd.h:288:
>
> *./seed.c:178:43: **warning: **sizeof on pointer operation will return size
> of 'const char *' instead of 'const char [2042]'*
>
> * [-Wsizeof-array-decay]*
>
> char * tag = scribble_get(sizeof (tag_fmt) + strlen(OPT_ARG(TAG)));
>
> * ^~~~~~~*
>
>
> *It seems like a pretty brain damaged interpretation.*
We'd need to see the code but the warning seems legit. What's the problem?
Marek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-20 18:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 18:51 Next question: sizeof(char buf[2042]) Bruce Korb
2018-06-20 18:52 ` Bruce Korb
2018-06-20 19:59 ` Marek Polacek
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).