From: Scott <drmemory@3rivers.net>
To: linux-c-programming@vger.kernel.org
Subject: Into the Void
Date: Tue, 25 Jan 2005 17:09:10 -0700 [thread overview]
Message-ID: <20050126000910.GC888@drmemory.local> (raw)
Years ago, I learned this trick from somebody in the C/C++ Journal, or
whatever that rag was called:
memcpy(*data_buf,bp,len)[len] = '\0';
I get the following error:
indatax.c: In function `read_datum':
indatax.c:374: warning: dereferencing `void *' pointer
indatax.c:374: invalid use of void expression
and if I cast the function:
(char *) memcpy(*data_buf,bp,len)[len] = '\0';
I get:
indatax.c: In function `read_datum':
indatax.c:374: warning: dereferencing `void *' pointer
indatax.c:374: void value not ignored as it ought to be
What aren't I understanding here? Tell me to go away if these
questions are too elementary for the list....
next reply other threads:[~2005-01-26 0:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-26 0:09 Scott [this message]
2005-01-26 2:18 ` Into the Void Ron Michael Khu
-- strict thread matches above, loose matches on Subject: below --
2005-01-26 13:45 Jeff.Fellin
2005-01-26 16:11 ` Scott
2005-01-27 4:02 ` Ron Michael Khu
2005-01-27 17:01 ` Scott
2005-01-26 16:02 Huber, George K RDECOM CERDEC STCD SRI
2005-01-27 17:58 Huber, George K RDECOM CERDEC STCD SRI
2005-01-28 4:36 ` Amit Dang
2005-02-01 15:32 Huber, George K RDECOM CERDEC STCD SRI
2005-02-02 12:15 ` Glynn Clements
2005-02-02 18:17 Huber, George K RDECOM CERDEC STCD SRI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050126000910.GC888@drmemory.local \
--to=drmemory@3rivers.net \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).