From: "Robert P. J. Day" <rpjday@mindspring.com>
To: C programming list <linux-c-programming@vger.kernel.org>
Subject: macros with global variables?
Date: Thu, 14 Jul 2005 08:35:15 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.63.0507140830420.4466@mathanlap1.rdmcorp.com> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1310 bytes --]
not sure if this is outside the scope of this mailing list but i
just downloaded the source for a simple SSL-aware ftp client
(netkit-ftp-ssl), did the configure and the make and got:
ftp.c: In function ârecvrequestâ:
ftp.c:1127: error: âpdataâundeclared (first use in this function)
ftp.c:1127: error: (Each undeclared identifier is reported only once
ftp.c:1127: error: for each function it appears in.)
ok, fair enough, check the offending header file to find the
following macro definition:
#define is_ssl_fd(X,Y) ( (SSL_get_fd((X))==0) || \
(SSL_get_fd((X))==1) || \
(SSL_get_fd((X))==pdata) || \
(SSL_get_fd((X))==(Y)) \
?????. so i have a macro which accepts two arguments, but expands
to include an explicit reference to something called "pdata", which
does not exist, hence the error message.
i tend to avoid defining macros that refer to anything but their own
arguments. what might the above mean? is there some well-known idiom
for C programmers that makes the above, in some way, acceptable?
(i've perused the code and the object "pdata", whatever that is, is
simply not defined anywhere. so is there a context in which the above
makes sense in some way?)
rday
next reply other threads:[~2005-07-14 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-14 12:35 Robert P. J. Day [this message]
2005-07-17 8:44 ` macros with global variables? Glynn Clements
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=Pine.LNX.4.63.0507140830420.4466@mathanlap1.rdmcorp.com \
--to=rpjday@mindspring.com \
--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).