[Bug 1983] New: cpukit/libnetworking/libc/gethostbyht.c:226:12: warning: ordered comparison of pointer with integer zero
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Wed Dec 7 06:04:38 UTC 2011
https://www.rtems.org/bugzilla/show_bug.cgi?id=1983
Summary: cpukit/libnetworking/libc/gethostbyht.c:226:12:
warning: ordered comparison of pointer with integer
zero
Product: RTEMS
Version: HEAD
Platform: All
OS/Version: RTEMS
Status: NEW
Severity: major
Priority: P3
Component: networking
AssignedTo: norume at aps.anl.gov
ReportedBy: ralf.corsepius at rtems.org
Building RTEMS raises the warning from the subject.
The part of the code this warning points to is the "if (hostf<0) return 0" line
from the fragment below:
...
static FILE *hostf = NULL;
...
struct hostent* gethostent_r(char* buf, int len)
{
...
if (hostf<0) return 0;
fseek(hostf,0,SEEK_END);
curlen=ftell(hostf);
fseek(hostf,0,SEEK_SET);
...
I do not understand how this code is supposed to work and believe it has never
worked.
ATM, my best guess is, this "hostf<0" should be "hostf == 0" (Abort if file has
not already been opened) - Agreed?
AFAIS, this bug is present in all versions of RTEMS >= 4.7.
Besides this, this code is really ancient/outdated and could use a major
upgrade.
--
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the bugs
mailing list