Makefile Linux

B

Barry

Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
is not a big program but cross-platform. I am not a programmer I have
tried Cmake but without success.
I want to bring a few changes in the source code text output and compile
many thanks if you can help me.

please mail me and i give you a link to the source code.
p.s remove nospam in email ;-)
 
D

David RF

Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
is not a big program but cross-platform. I am not a programmer I have
tried Cmake but without success.
I want to bring a few changes in the source code text output and compile
many thanks if you can help me.

please mail me and i give you a link to the source code.
p.s remove nospam in email ;-)

GNU Libtool and automake?

http://en.wikipedia.org/wiki/Libtool
 
J

James Kuyper

Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
is not a big program but cross-platform. I am not a programmer I have
tried Cmake but without success.

I'm not familiar with Cmake, but a quick look at cmake.org suggests that
it creates make files for you. Have you tried using "make" with a
manually-created make file? I won't claim that make file syntax is easy,
but it's not horribly complicated, either.

Neither "Cmake" nor "make" are part of C, but "make" is part of Unix, so
you're likely to get better answers to your question on
comp.unix.programmer. You could also try
<http://www.cmake.org/cmake/help/help.html>

No matter where you post your question, I recommend being a lot more
specific about your problem. It's trivial to create a make file. Since
make is normally configured to implement a lot of useful default rules,
you can even use make with an empty make file (or equivalently, with no
make file at all). I do this quite frequently. The thing that can get
tricky is trying to do some particular thing with a make file, and you
need to explain what that particular thing is before anyone can help you
do it. In particular, you should go into detail explaining how your
attempt to use Cmake failed.
 
B

Barry

Op 13-6-2012 13:02, James Kuyper schreef:
I'm not familiar with Cmake, but a quick look at cmake.org suggests that
it creates make files for you. Have you tried using "make" with a
manually-created make file? I won't claim that make file syntax is easy,
but it's not horribly complicated, either.

Neither "Cmake" nor "make" are part of C, but "make" is part of Unix, so
you're likely to get better answers to your question on
comp.unix.programmer. You could also try
<http://www.cmake.org/cmake/help/help.html>

No matter where you post your question, I recommend being a lot more
specific about your problem. It's trivial to create a make file. Since
make is normally configured to implement a lot of useful default rules,
you can even use make with an empty make file (or equivalently, with no
make file at all). I do this quite frequently. The thing that can get
tricky is trying to do some particular thing with a make file, and you
need to explain what that particular thing is before anyone can help you
do it. In particular, you should go into detail explaining how your
attempt to use Cmake failed.

It's hard to explain but I think the problem lies in #ifdef isunix
#endif statement.
maybe if you see the source code that a makes a lot clear.
here is the link:
http://members.chello.nl/~b.vandenbos/source.zip


I also added to the CMakeLists.txt
I would very happy if I have a working makefile.
And thanks for your response.

Barry
 
J

James Kuyper

On 06/13/2012 08:36 AM, Barry wrote:
....
It's hard to explain but I think the problem lies in #ifdef isunix
#endif statement.

You misunderstand. That's a diagnosis. By definition, if you're looking
for other people's help, your diagnosis is, at best, unreliable, and
more likely completely worthless. When asking for other people's help,
the most important information you need to give them are the symptoms,
not your diagnosis. What did you try to do? What precisely happened when
you tried it? In particular, the full text of any error or warning
messages that you observed would be very helpful.

By the way, do you expect 'isunix' to be defined? If so, why? I'm not
saying it won't be, just that I need to know your reasons for expecting
it to be. It's not mentioned in the Unix standard. As far as the C
standard is concerned, it's a name reserved for developers, so a
conforming implementation is not allowed to pre-define it. It's not
#defined anywhere in your code. Therefore, it would have to be set
somewhere else. Adding -Disunix to your command line will predefine it
on all of the compilers I'm familiar with, but the syntax may be
different on other compilers.

If that is part of your issue, comp.unix.programmer is definitely a
better place to go with your questions.
 
B

Barry

Op 13-6-2012 15:36, James Kuyper schreef:
On 06/13/2012 08:36 AM, Barry wrote:
...

You misunderstand. That's a diagnosis. By definition, if you're looking
for other people's help, your diagnosis is, at best, unreliable, and
more likely completely worthless. When asking for other people's help,
the most important information you need to give them are the symptoms,
not your diagnosis. What did you try to do? What precisely happened when
you tried it? In particular, the full text of any error or warning
messages that you observed would be very helpful.

By the way, do you expect 'isunix' to be defined? If so, why? I'm not
saying it won't be, just that I need to know your reasons for expecting
it to be. It's not mentioned in the Unix standard. As far as the C
standard is concerned, it's a name reserved for developers, so a
conforming implementation is not allowed to pre-define it. It's not
#defined anywhere in your code. Therefore, it would have to be set
somewhere else. Adding -Disunix to your command line will predefine it
on all of the compilers I'm familiar with, but the syntax may be
different on other compilers.

If that is part of your issue, comp.unix.programmer is definitely a
better place to go with your questions.

this is what i get when i run make.


[ 0%] Building C object CMakeFiles/dnewsweb.dir/dnewsweb.c.o
/home/barry/dw2/dnewsweb.c: In function âmainâ:
/home/barry/dw2/dnewsweb.c:607: warning: implicit declaration of
function âputenvâ
/home/barry/dw2/dnewsweb.c:645: error: âenvironâ undeclared (first use
in this function)
/home/barry/dw2/dnewsweb.c:645: error: (Each undeclared identifier is
reported only once
/home/barry/dw2/dnewsweb.c:645: error: for each function it appears in.)
/home/barry/dw2/dnewsweb.c:685: warning: implicit declaration of
function âini_trueâ
/home/barry/dw2/dnewsweb.c:790: warning: implicit declaration of
function âispressedâ
/home/barry/dw2/dnewsweb.c:881: warning: implicit declaration of
function âlog_useâ
/home/barry/dw2/dnewsweb.c: In function âlog_useâ:
/home/barry/dw2/dnewsweb.c:908: warning: implicit declaration of
function âgetpidâ
/home/barry/dw2/dnewsweb.c:908: warning: format â%dâ expects type âintâ,
but argument 3 has type âtime_tâ
/home/barry/dw2/dnewsweb.c: In function âset_utagâ:
/home/barry/dw2/dnewsweb.c:943: warning: implicit declaration of
function âuser_readâ
/home/barry/dw2/dnewsweb.c: In function ânntp_read_timeoutâ:
/home/barry/dw2/dnewsweb.c:1054: warning: implicit declaration of
function ânntp_chanwaitâ
/home/barry/dw2/dnewsweb.c: In function âreverse_xoverâ:
/home/barry/dw2/dnewsweb.c:1333: warning: implicit declaration of
function âstr_insertsnâ
/home/barry/dw2/dnewsweb.c: In function âshow_article_partâ:
/home/barry/dw2/dnewsweb.c:1604: warning: implicit declaration of
function âydecodeâ
/home/barry/dw2/dnewsweb.c:1632: warning: implicit declaration of
function âboundary_checkâ
/home/barry/dw2/dnewsweb.c: In function âf_cancelâ:
/home/barry/dw2/dnewsweb.c:1836: warning: implicit declaration of
function âisloginâ
/home/barry/dw2/dnewsweb.c:1870: warning: implicit declaration of
function âgroup_readonlyâ
/home/barry/dw2/dnewsweb.c: In function âr_configâ:
/home/barry/dw2/dnewsweb.c:2006: warning: implicit declaration of
function âuser_writeâ
/home/barry/dw2/dnewsweb.c: In function âr_loginâ:
/home/barry/dw2/dnewsweb.c:2030: warning: implicit declaration of
function âpop_checkâ
/home/barry/dw2/dnewsweb.c: In function âr_partsâ:
/home/barry/dw2/dnewsweb.c:4055: warning: implicit declaration of
function âdecode_urlâ
/home/barry/dw2/dnewsweb.c:4103: warning: implicit declaration of
function âparts_subject_yencâ
/home/barry/dw2/dnewsweb.c: In function âr_postâ:
/home/barry/dw2/dnewsweb.c:5040: warning: implicit declaration of
function âbase64_encodeâ
/home/barry/dw2/dnewsweb.c:5059: warning: implicit declaration of
function âuuencâ
/home/barry/dw2/dnewsweb.c: In function âtemp_fnameâ:
/home/barry/dw2/dnewsweb.c:5139: warning: implicit declaration of
function âmktempâ
/home/barry/dw2/dnewsweb.c:5139: warning: assignment makes pointer from
integer without a cast
/home/barry/dw2/dnewsweb.c: In function âshow_dlineâ:
/home/barry/dw2/dnewsweb.c:5217: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c:5230: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c: In function âattach_fnameâ:
/home/barry/dw2/dnewsweb.c:6007: warning: assignment makes pointer from
integer without a cast
/home/barry/dw2/dnewsweb.c: In function âtpl_replaceâ:
/home/barry/dw2/dnewsweb.c:6862: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c:6864: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c: In function âdisplay_infoâ:
/home/barry/dw2/dnewsweb.c:8887: error: âenvironâ undeclared (first use
in this function)
make[2]: *** [CMakeFiles/dnewsweb.dir/dnewsweb.c.o] Fout 1
make[1]: *** [CMakeFiles/dnewsweb.dir/all] Fout 2
make: *** [all] Fout 2
 
S

Stephen Sprunk

It's hard to explain but I think the problem lies in #ifdef isunix
#endif statement.
maybe if you see the source code that a makes a lot clear.
here is the link:
http://members.chello.nl/~b.vandenbos/source.zip

This appears to be the source to copyrighted, closed-source software
which is available pre-compiled for Linux on the copyright owner's web site.

Therefore, I deduce that you have somehow managed to obtain stolen
source code and are asking us to help you further your attempts to
infringe on the owner's rights by compiling and using this source
without a license, which may be a crime not just for you but also for
the people you're asking to help you.

Nice try, but I deleted the code as soon as I figured out what it was
and suggest everyone else do the same--including you, "Barry".

S
 
B

Barry

Op 14-6-2012 1:12, Stephen Sprunk schreef:
This appears to be the source to copyrighted, closed-source software
which is available pre-compiled for Linux on the copyright owner's web site.

Therefore, I deduce that you have somehow managed to obtain stolen
source code and are asking us to help you further your attempts to
infringe on the owner's rights by compiling and using this source
without a license, which may be a crime not just for you but also for
the people you're asking to help you.

Nice try, but I deleted the code as soon as I figured out what it was
and suggest everyone else do the same--including you, "Barry".

S
no I got it from them.
 
J

James Kuyper

On 06/13/2012 11:17 AM, Barry wrote:
....
this is what i get when i run make.


[ 0%] Building C object CMakeFiles/dnewsweb.dir/dnewsweb.c.o
/home/barry/dw2/dnewsweb.c: In function âmainâ:
/home/barry/dw2/dnewsweb.c:607: warning: implicit declaration of
function âputenvâ

Lets start with this. putenv() is an X-Open extension to the C standard
library. It is supposed to be declared in <stdlib.h>, which is #included
in NetWin's code. Like most such extensions, it uses a name reserved by
the C standard library. As a result, an implementation of the C standard
library CANNOT have a declaration of putenv() in <stdlib.h> if invoked
in conforming mode, unless you do something that makes the behavior
undefined. What precisely you need to do depends upon the implementation
of C that you're using.

The man page for my Linux machine indicates that if I #define either
_SVID_SOURCE or _XOPEN_SOURCE before #including <stdlib.h>, that will do
the job. Those identifiers are reserved to the implementation for all
uses, and #defining them therefore give your code undefined behavior,
which gives the compiler permission to add in non-conforming extensions
like putenv().

I tried it, and invoking gcc with -Disunix and either -D_SVID_SOURCE or
-D_XOPEN_SOURCE removed all of the error messages. There's still a huge
number of warning messages - this code would never pass a code review in
my group - but it does compile.
 
J

James Kuyper

On 06/13/2012 10:26 PM, James Kuyper wrote:
....
Lets start with this. putenv() is an X-Open extension to the C standard
library. It is supposed to be declared in <stdlib.h>, which is #included
in NetWin's code. Like most such extensions, it uses a name reserved by
the C standard library.

Correction: that was supposed to say "... reserved by the C standard for
users". If it were reserved for the implementation, there wouldn't be an
issue, but because it's reserved for users, it can't normally be
declared by the C standard library headers.
 
S

Stephen Sprunk

Op 14-6-2012 1:12, Stephen Sprunk schreef:

no I got it from them.

If so, just ask them for the makefiles or other scripts that _they_ use
to build the project.

S
 
B

Barry

Op 14-6-2012 5:34, Stephen Sprunk schreef:
If so, just ask them for the makefiles or other scripts that _they_ use
to build the project.

S
that I did this was their response:


Ok, here is the source which seems to compile on windows. Sorry I can't
find the unix make files so you will have to recreate..
 
J

James Kuyper

Op 14-6-2012 5:34, Stephen Sprunk schreef:
that I did this was their response:


Ok, here is the source which seems to compile on windows. Sorry I can't
find the unix make files so you will have to recreate..

Put the following text in a file named 'makefile' in the same directory
as NetWin's source code:

LDLIBS = -lm
CFLAGS = -Disunix -D_SVID_OBJECT
dnewsweb: chan_dmy.o conf_dmy.o decode.o dnewsdmy.o dnewsweb.o \
keylib.o lib.o lprintf.o memdebug.o mime64.o nntp.o parsedate.o \
sary.o uuencode.o web_mem.o web_str.o wild.o

Then type 'make' to build your program.

If you're using gcc, I'd recommend adding the following options to
CFLAGS: -std=c99 -pedantic -Wall -Wpointer-arith -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes

However, note that specifying -std=c99 would force gcc to recognize as
trigraphs things in that code which were obviously not intended to be
trigraphs. Make sure to fix those before using it.

I removed unistd.h from that directory; it seemed like a wildly unsafe
thing to have hanging around. The makefile I've given you does not link
in unixbf.o, which also seemed like a very bad idea. I suspect there's a
lot more similar bad ideas in that code. I'd recommend fixing the code
to remove every single warning message generated by that make command
before actually executing this program.
 
B

Barry

Op 14-6-2012 4:30, James Kuyper schreef:
On 06/13/2012 10:26 PM, James Kuyper wrote:
...

Correction: that was supposed to say "... reserved by the C standard for
users". If it were reserved for the implementation, there wouldn't be an
issue, but because it's reserved for users, it can't normally be
declared by the C standard library headers.

Hello James

Thanks for your comment I just can't get together unfortunately.
can you give me the line that you used gcc .......
and must there be c script added at the line for example,
gcc ...... -Disunix nttp.c lprintf.c uuencode.c.... etc.
many thanks for your help.

Barry
 
B

Barry

Op 14-6-2012 14:47, James Kuyper schreef:
Put the following text in a file named 'makefile' in the same directory
as NetWin's source code:

LDLIBS = -lm
CFLAGS = -Disunix -D_SVID_OBJECT
dnewsweb: chan_dmy.o conf_dmy.o decode.o dnewsdmy.o dnewsweb.o \
keylib.o lib.o lprintf.o memdebug.o mime64.o nntp.o parsedate.o \
sary.o uuencode.o web_mem.o web_str.o wild.o

Then type 'make' to build your program.

If you're using gcc, I'd recommend adding the following options to
CFLAGS: -std=c99 -pedantic -Wall -Wpointer-arith -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes

However, note that specifying -std=c99 would force gcc to recognize as
trigraphs things in that code which were obviously not intended to be
trigraphs. Make sure to fix those before using it.

I removed unistd.h from that directory; it seemed like a wildly unsafe
thing to have hanging around. The makefile I've given you does not link
in unixbf.o, which also seemed like a very bad idea. I suspect there's a
lot more similar bad ideas in that code. I'd recommend fixing the code
to remove every single warning message generated by that make command
before actually executing this program.

hi james
thanks again for your help I get 5 files:conf_dmy.o decode.o dnewsdmy.o
chan_dmy.o dnewsweb.o
makefile a use:
LDLIBS = -lm
CFLAGS = -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall
-Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes
dnewsweb: chan_dmy.o conf_dmy.o decode.o dnewsdmy.o dnewsweb.o \
keylib.o lib.o lprintf.o memdebug.o mime64.o nntp.o parsedate.o \
sary.o uuencode.o web_mem.o web_str.o wild.o





The original binary file dnewsweb is 800Kb
 
B

Barry

Op 14-6-2012 14:47, James Kuyper schreef:
Put the following text in a file named 'makefile' in the same directory
as NetWin's source code:

LDLIBS = -lm
CFLAGS = -Disunix -D_SVID_OBJECT
dnewsweb: chan_dmy.o conf_dmy.o decode.o dnewsdmy.o dnewsweb.o \
keylib.o lib.o lprintf.o memdebug.o mime64.o nntp.o parsedate.o \
sary.o uuencode.o web_mem.o web_str.o wild.o

Then type 'make' to build your program.

If you're using gcc, I'd recommend adding the following options to
CFLAGS: -std=c99 -pedantic -Wall -Wpointer-arith -Wcast-align
-Wstrict-prototypes -Wmissing-prototypes

However, note that specifying -std=c99 would force gcc to recognize as
trigraphs things in that code which were obviously not intended to be
trigraphs. Make sure to fix those before using it.

I removed unistd.h from that directory; it seemed like a wildly unsafe
thing to have hanging around. The makefile I've given you does not link
in unixbf.o, which also seemed like a very bad idea. I suspect there's a
lot more similar bad ideas in that code. I'd recommend fixing the code
to remove every single warning message generated by that make command
before actually executing this program.

make output

cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o dnewsweb.o
dnewsweb.c
dnewsweb.c:481: warning: no previous prototype for ‘page_size’
dnewsweb.c:559: warning: no previous prototype for ‘bad_input’
dnewsweb.c: In function ‘main’:
dnewsweb.c:607: warning: implicit declaration of function ‘putenv’
dnewsweb.c:685: warning: implicit declaration of function ‘ini_true’
dnewsweb.c:790: warning: implicit declaration of function ‘ispressed’
dnewsweb.c:881: warning: implicit declaration of function ‘log_use’
dnewsweb.c: At top level:
dnewsweb.c:902: warning: no previous prototype for ‘log_use’
dnewsweb.c: In function ‘log_use’:
dnewsweb.c:908: warning: format ‘%d’ expects type ‘int’, but
argument 3 has type ‘time_t’
dnewsweb.c: In function ‘set_utag’:
dnewsweb.c:943: warning: implicit declaration of function ‘user_read’
dnewsweb.c: At top level:
dnewsweb.c:969: warning: no previous prototype for ‘ini_true’
dnewsweb.c:1022: warning: no previous prototype for ‘ispressed’
dnewsweb.c: In function ‘nntp_read_timeout’:
dnewsweb.c:1054: warning: implicit declaration of function
‘nntp_chanwait’
dnewsweb.c:1052: warning: unused variable ‘i’
dnewsweb.c: At top level:
dnewsweb.c:1092: warning: no previous prototype for ‘group_allow’
dnewsweb.c:1105: warning: no previous prototype for ‘group_allow_silent’
dnewsweb.c:1117: warning: no previous prototype for ‘read_pop’
dnewsweb.c:1155: warning: no previous prototype for ‘get_linex’
dnewsweb.c:1184: warning: no previous prototype for ‘get_line_nowrap’
dnewsweb.c: In function ‘get_line’:
dnewsweb.c:1209: warning: unused variable ‘slen’
dnewsweb.c: At top level:
dnewsweb.c:1272: warning: no previous prototype for ‘show_xbar’
dnewsweb.c:1325: warning: no previous prototype for ‘reverse_xover’
dnewsweb.c: In function ‘reverse_xover’:
dnewsweb.c:1333: warning: implicit declaration of function
‘str_insertsn’
dnewsweb.c: At top level:
dnewsweb.c:1352: warning: no previous prototype for ‘show_search’
dnewsweb.c:1382: warning: no previous prototype for ‘show_dlist’
dnewsweb.c:1401: warning: no previous prototype for ‘head_get’
dnewsweb.c:1416: warning: no previous prototype for ‘do_content_part’
dnewsweb.c: In function ‘show_article_part’:
dnewsweb.c:1604: warning: implicit declaration of function ‘ydecode’
dnewsweb.c:1632: warning: implicit declaration of function
‘boundary_check’
dnewsweb.c:1459: warning: unused variable ‘authenticated_user’
dnewsweb.c: At top level:
dnewsweb.c:1708: warning: no previous prototype for ‘show_article1’
dnewsweb.c:1779: warning: no previous prototype for ‘show_article3’
dnewsweb.c:1795: warning: no previous prototype for ‘f_postXX’
dnewsweb.c: In function ‘f_cancel’:
dnewsweb.c:1836: warning: implicit declaration of function ‘islogin’
dnewsweb.c:1870: warning: implicit declaration of function
‘group_readonly’
dnewsweb.c:1829: warning: unused variable ‘p’
dnewsweb.c:1825: warning: unused variable ‘bf2’
dnewsweb.c: In function ‘r_config’:
dnewsweb.c:2006: warning: implicit declaration of function ‘user_write’
dnewsweb.c: In function ‘r_login’:
dnewsweb.c:2030: warning: implicit declaration of function ‘pop_check’
dnewsweb.c: At top level:
dnewsweb.c:2197: warning: no previous prototype for ‘tpl_show_gsearch’
dnewsweb.c: In function ‘tpl_show_gsearch’:
dnewsweb.c:2203: warning: unused variable ‘from’
dnewsweb.c:2203: warning: unused variable ‘n’
dnewsweb.c:2202: warning: unused variable ‘i’
dnewsweb.c: At top level:
dnewsweb.c:2229: warning: no previous prototype for ‘tpl_show_groups’
dnewsweb.c:2264: warning: no previous prototype for
‘tpl_show_group_list’
dnewsweb.c: In function ‘tpl_show_group_list’:
dnewsweb.c:2268: warning: unused variable ‘i’
dnewsweb.c: At top level:
dnewsweb.c:2331: warning: no previous prototype for ‘user_file’
dnewsweb.c:2358: warning: no previous prototype for ‘ini_work’
dnewsweb.c:2373: warning: no previous prototype for ‘user_write’
dnewsweb.c:2414: warning: no previous prototype for ‘user_read’
dnewsweb.c:2548: warning: no previous prototype for ‘nntp_check’
dnewsweb.c:2565: warning: no previous prototype for ‘pop_check’
dnewsweb.c: In function ‘f_login’:
dnewsweb.c:2617: warning: unused variable ‘bf’
dnewsweb.c: At top level:
dnewsweb.c:2672: warning: no previous prototype for ‘f_find_xold’
dnewsweb.c:2700: warning: no previous prototype for ‘form_date’
dnewsweb.c:2854: warning: no previous prototype for ‘do_latest_authent’
dnewsweb.c:2878: warning: no previous prototype for ‘group_readonly’
dnewsweb.c: In function ‘f_follow’:
dnewsweb.c:2902: warning: unused variable ‘p’
dnewsweb.c: At top level:
dnewsweb.c:3037: warning: function declaration isn’t a prototype
dnewsweb.c:3050: warning: ISO C does not allow extra ‘;’ outside of
a function
dnewsweb.c: In function ‘show_xline’:
dnewsweb.c:3067: warning: unused variable ‘max’
dnewsweb.c:3057: warning: unused variable ‘frotesm’
dnewsweb.c: At top level:
dnewsweb.c:3152: warning: no previous prototype for ‘lib_nore’
dnewsweb.c:3201: warning: no previous prototype for ‘the_cmp’
dnewsweb.c:3210: warning: no previous prototype for ‘sort_the_xover’
dnewsweb.c: In function ‘sort_the_xover’:
dnewsweb.c:3213: warning: unused variable ‘s’
dnewsweb.c: At top level:
dnewsweb.c:3252: warning: no previous prototype for ‘xover_cmp’
dnewsweb.c:3260: warning: no previous prototype for ‘xover_cmp_old’
dnewsweb.c:3349: warning: no previous prototype for ‘require_login’
dnewsweb.c: In function ‘cmd_thread_both’:
dnewsweb.c:3693: warning: unused variable ‘p’
dnewsweb.c:3692: warning: unused variable ‘np’
dnewsweb.c: At top level:
dnewsweb.c:3820: warning: no previous prototype for ‘nobble_script’
dnewsweb.c: In function ‘r_parts’:
dnewsweb.c:4055: warning: implicit declaration of function ‘decode_url’
dnewsweb.c:4070: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c:4103: warning: implicit declaration of function
‘parts_subject_yenc’
dnewsweb.c:4185: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c:4027: warning: unused variable ‘xbf’
dnewsweb.c: In function ‘fix_crlf’:
dnewsweb.c:4273: warning: unused variable ‘wrap’
dnewsweb.c:4272: warning: unused variable ‘len’
dnewsweb.c: At top level:
dnewsweb.c:4294: warning: no previous prototype for ‘do_addbr’
dnewsweb.c: In function ‘do_addbr’:
dnewsweb.c:4296: warning: unused variable ‘len’
dnewsweb.c: In function ‘JLLformat_wrap_output’:
dnewsweb.c:4462: warning: unused variable ‘doneline’
dnewsweb.c: At top level:
dnewsweb.c:4565: warning: no previous prototype for ‘fix_email’
dnewsweb.c:4591: warning: no previous prototype for ‘stripeol’
dnewsweb.c:4619: warning: no previous prototype for ‘islogin’
dnewsweb.c:4671: warning: no previous prototype for ‘add_custom_header’
dnewsweb.c: In function ‘r_post’:
dnewsweb.c:5011: warning: suggest explicit braces to avoid
ambiguous ‘else’
dnewsweb.c:5040: warning: implicit declaration of function
‘base64_encode’
dnewsweb.c:5059: warning: implicit declaration of function ‘uuenc’
dnewsweb.c:4816: warning: label ‘nofrom’ defined but not used
dnewsweb.c:4743: warning: unused variable ‘xout’
dnewsweb.c: In function ‘temp_fname’:
dnewsweb.c:5139: warning: implicit declaration of function ‘mktemp’
dnewsweb.c:5139: warning: assignment makes pointer from integer without
a cast
dnewsweb.c: In function ‘show_dline’:
dnewsweb.c:5217: warning: format not a string literal and no format
arguments
dnewsweb.c:5230: warning: format not a string literal and no format
arguments
dnewsweb.c:5231: warning: too many arguments for format
dnewsweb.c: At top level:
dnewsweb.c:5492: warning: no previous prototype for ‘group_name’
dnewsweb.c:5552: warning: no previous prototype for ‘lib_encode_more’
dnewsweb.c: In function ‘value_encode’:
dnewsweb.c:5578: warning: unused variable ‘addend’
dnewsweb.c:5577: warning: unused variable ‘iniso’
dnewsweb.c: At top level:
dnewsweb.c:5731: warning: no previous prototype for ‘decode_base64text’
dnewsweb.c:5745: warning: ISO C does not allow extra ‘;’ outside of
a function
dnewsweb.c:5747: warning: no previous prototype for ‘hexbyte’
dnewsweb.c: In function ‘hexbyte’:
dnewsweb.c:5753: warning: format ‘%x’ expects type ‘unsigned
int *’, but argument 3 has type ‘int *’
dnewsweb.c: At top level:
dnewsweb.c:5758: warning: no previous prototype for ‘decode_quote_eol’
dnewsweb.c:5762: warning: no previous prototype for ‘decode_quote’
dnewsweb.c:5802: warning: no previous prototype for ‘text_encode’
dnewsweb.c:5886: warning: no previous prototype for ‘log_hacker’
dnewsweb.c: In function ‘getword’:
dnewsweb.c:5959: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c: In function ‘attach_fname’:
dnewsweb.c:6007: warning: assignment makes pointer from integer without
a cast
dnewsweb.c: At top level:
dnewsweb.c:6041: warning: no previous prototype for ‘form_get_mime’
dnewsweb.c: In function ‘makeword’:
dnewsweb.c:6215: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c: At top level:
dnewsweb.c:6260: warning: no previous prototype for ‘form_find_i’
dnewsweb.c: In function ‘tohtml’:
dnewsweb.c:6423: warning: too many arguments for format
dnewsweb.c:6424: warning: too many arguments for format
dnewsweb.c: At top level:
dnewsweb.c:6522: warning: no previous prototype for ‘tpl_indenton’
dnewsweb.c:6529: warning: no previous prototype for ‘tpl_indentoff’
dnewsweb.c:6537: warning: no previous prototype for ‘tpl_setindent’
dnewsweb.c:6713: warning: no previous prototype for
‘tpl_get_latest_groups’
dnewsweb.c: In function ‘tpl_get_latest_groups’:
dnewsweb.c:6718: warning: unused variable ‘i’
dnewsweb.c: In function ‘tpl_replace’:
dnewsweb.c:6862: warning: format not a string literal and no format
arguments
dnewsweb.c:6864: warning: format not a string literal and no format
arguments
dnewsweb.c: At top level:
dnewsweb.c:7014: warning: no previous prototype for ‘ref_find’
dnewsweb.c:7031: warning: no previous prototype for ‘ref_depth’
dnewsweb.c:7054: warning: no previous prototype for ‘srt_order’
dnewsweb.c:7067: warning: no previous prototype for ‘do_spaces’
dnewsweb.c:7083: warning: no previous prototype for ‘subj_cmp’
dnewsweb.c:7158: warning: no previous prototype for ‘show_kbytes’
dnewsweb.c:7432: warning: no previous prototype for ‘h_replace’
dnewsweb.c:7525: warning: no previous prototype for ‘month_n’
dnewsweb.c:7616: warning: no previous prototype for ‘tpl_show_top’
dnewsweb.c: In function ‘show_raw’:
dnewsweb.c:7623: warning: unused variable ‘item’
dnewsweb.c: At top level:
dnewsweb.c:7647: warning: no previous prototype for ‘get_body_n’
dnewsweb.c:7664: warning: no previous prototype for ‘trim_quotes’
dnewsweb.c: In function ‘tpl_init_item’:
dnewsweb.c:7686: warning: unused variable ‘x’
dnewsweb.c: In function ‘tpl_set_latest_vars’:
dnewsweb.c:7871: warning: unused variable ‘s2’
dnewsweb.c:7870: warning: unused variable ‘bf’
dnewsweb.c:7859: warning: unused variable ‘x’
dnewsweb.c: At top level:
dnewsweb.c:8030: warning: no previous prototype for ‘str_sanitize’
dnewsweb.c:8061: warning: no previous prototype for ‘savename’
dnewsweb.c:8106: warning: no previous prototype for ‘boundary_check’
dnewsweb.c: In function ‘tpl_show_item’:
dnewsweb.c:8218: warning: suggest explicit braces to avoid
ambiguous ‘else’
dnewsweb.c:8265: warning: suggest explicit braces to avoid
ambiguous ‘else’
dnewsweb.c:8449: warning: suggest explicit braces to avoid
ambiguous ‘else’
dnewsweb.c:8160: warning: unused variable ‘b3’
dnewsweb.c:8156: warning: unused variable ‘isyenc’
dnewsweb.c: At top level:
dnewsweb.c:8684: warning: no previous prototype for ‘tomail_read_item’
dnewsweb.c: In function ‘cmd_tomail_add’:
dnewsweb.c:8762: warning: unused variable ‘subj’
dnewsweb.c:8760: warning: unused variable ‘item’
dnewsweb.c:8758: warning: unused variable ‘mid’
dnewsweb.c: In function ‘cmd_tomail_del’:
dnewsweb.c:8790: warning: unused variable ‘subj’
dnewsweb.c:8788: warning: unused variable ‘item’
dnewsweb.c:8786: warning: unused variable ‘mid’
dnewsweb.c: In function ‘display_info’:
dnewsweb.c:8828: warning: unused variable ‘k’
dnewsweb.c: In function ‘tpl_get_nitems’:
dnewsweb.c:8931: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c:8940: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c:8942: warning: suggest parentheses around assignment used as
truth value
dnewsweb.c: At top level:
memdebug.h:128: warning: ‘m_names’ defined but not used
dnewsweb.c:535: warning: ‘groupe’ defined but not used
dnewsweb.c:6519: warning: ‘tpl_dir’ defined but not used
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o chan_dmy.o
chan_dmy.c
chan_dmy.c:3: warning: no previous prototype for ‘post_seterr’
chan_dmy.c:4: warning: no previous prototype for ‘chan_elimit’
chan_dmy.c:8: warning: no previous prototype for ‘chan_isihave’
chan_dmy.c:12: warning: no previous prototype for ‘chan_isready’
chan_dmy.c:16: warning: no previous prototype for ‘chan_outspeed’
chan_dmy.c:21: warning: no previous prototype for ‘sponser_enable_free’
chan_dmy.c:26: warning: no previous prototype for ‘chan_ismore’
chan_dmy.c:31: warning: return type defaults to ‘int’
chan_dmy.c:30: warning: no previous prototype for ‘chan_ihaveonly’
chan_dmy.c:34: warning: no previous prototype for ‘chan_nusers’
chan_dmy.c:38: warning: no previous prototype for ‘imsgf’
chan_dmy.c:42: warning: no previous prototype for ‘group_status’
chan_dmy.c:43: warning: no previous prototype for ‘hist_status’
chan_dmy.c:44: warning: no previous prototype for ‘ihavein_clear’
chan_dmy.c:45: warning: no previous prototype for ‘chan_newchan’
chan_dmy.c:46: warning: no previous prototype for ‘chan_isfree’
chan_dmy.c:49: warning: no previous prototype for ‘cmd_finish’
chan_dmy.c:50: warning: no previous prototype for ‘chan_getipnum’
chan_dmy.c:55: warning: no previous prototype for ‘chan_init’
chan_dmy.c:58: warning: no previous prototype for ‘access_read’
chan_dmy.c:62: warning: no previous prototype for ‘channel_read’
chan_dmy.c:64: warning: no previous prototype for ‘chan_canpost’
chan_dmy.c:68: warning: no previous prototype for ‘chan_getipname’
chan_dmy.c:72: warning: no previous prototype for ‘chan_setipname’
chan_dmy.c:75: warning: no previous prototype for ‘chan_setipnum’
chan_dmy.c:78: warning: no previous prototype for ‘chan_cantalk’
chan_dmy.c:82: warning: no previous prototype for ‘suck_do’
chan_dmy.c:83: warning: no previous prototype for ‘group_namelc’
chan_dmy.c:84: warning: no previous prototype for ‘group_namelc_x’
chan_dmy.c:85: warning: no previous prototype for ‘stats_cmd’
chan_dmy.c:86: warning: no previous prototype for ‘stats_end’
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o conf_dmy.o
conf_dmy.c
conf_dmy.c: In function ‘config_set’:
conf_dmy.c:40: warning: implicit declaration of function ‘strdup’
conf_dmy.c:40: warning: assignment makes pointer from integer without a cast
conf_dmy.c: In function ‘config_load’:
conf_dmy.c:57: warning: unused variable ‘j’
conf_dmy.c: At top level:
memdebug.h:128: warning: ‘m_names’ defined but not used
conf.h:514: warning: ‘conf_name’ defined but not used
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o decode.o
decode.c
decode.c: In function ‘decode_rfc1522’:
decode.c:121: warning: implicit declaration of function ‘ncpy’
decode.c:153: warning: implicit declaration of function ‘imsg’
decode.c: At top level:
decode.c:163: warning: no previous prototype for ‘ydecode’
decode.c:181: warning: no previous prototype for ‘decode_url’
decode.c: In function ‘decode_url’:
decode.c:195: warning: implicit declaration of function ‘strlwr’
decode.c:206: warning: implicit declaration of function ‘strtol’
decode.c: At top level:
decode.c:86: warning: ‘alphabet’ defined but not used
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o dnewsdmy.o
dnewsdmy.c
dnewsdmy.c:2: warning: no previous prototype for ‘status_recent’
dnewsdmy.c:6: warning: no previous prototype for ‘fx_total’
dnewsdmy.c:10: warning: no previous prototype for ‘is_reader’
dnewsdmy.c:14: warning: no previous prototype for ‘keeplog’
dnewsdmy.c:17: warning: no previous prototype for ‘chan_inspeed’
dnewsdmy.c:21: warning: no previous prototype for ‘xxkeylib_check_file’
dnewsdmy.c:26: warning: function declaration isn’t a prototype
dnewsdmy.c:29: warning: no previous prototype for ‘mutex_wait’
dnewsdmy.c:32: warning: no previous prototype for ‘mutex_release’
dnewsdmy.c:36: warning: no previous prototype for ‘hist_freechan’
dnewsdmy.c:40: warning: no previous prototype for ‘dnews_memdebug’
dnewsdmy.c:44: warning: no previous prototype for ‘echan_set’
dnewsdmy.c:47: warning: no previous prototype for ‘user_addrej’
dnewsdmy.c:50: warning: no previous prototype for ‘chan_closing’
dnewsdmy.c:53: warning: no previous prototype for ‘lib_checkspace’
dnewsdmy.c:57: warning: no previous prototype for ‘hist_status_s’
dnewsdmy.c:63: warning: no previous prototype for ‘slave_port’
dnewsdmy.c:67: warning: no previous prototype for ‘slave_n’
dnewsdmy.c:71: warning: no previous prototype for ‘is_slave’
dnewsdmy.c:75: warning: no previous prototype for ‘db_spool_dir’
dnewsdmy.c:79: warning: no previous prototype for ‘db_total_space’
dnewsdmy.c:83: warning: no previous prototype for ‘new_make’
dnewsdmy.c:87: warning: no previous prototype for ‘new_test’
dnewsdmy.c:91: warning: no previous prototype for ‘stats_clock’
dnewsdmy.c:95: warning: no previous prototype for ‘stats_add’
dnewsdmy.c:99: warning: no previous prototype for ‘stat_start’
dnewsdmy.c:100: warning: no previous prototype for ‘stat_end’
dnewsdmy.c:103: warning: no previous prototype for ‘dom_free’
dnewsdmy.c:107: warning: no previous prototype for ‘dom_reload’
dnewsdmy.c:111: warning: no previous prototype for ‘dom_add’
dnewsdmy.c:114: warning: no previous prototype for ‘dom_setdom’
dnewsdmy.c:119: warning: no previous prototype for ‘dom_ini_get’
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o keylib.o
keylib.c
In file included from keylib.c:106:
keylib.h:68: warning: missing braces around initializer
keylib.h:68: warning: (near initialization for ‘knames[0]’)
keylib.h:149: warning: missing braces around initializer
keylib.h:149: warning: (near initialization for ‘products[0]’)
keylib.c:215: warning: no previous prototype for ‘keylib_mon_find’
keylib.c:226: warning: no previous prototype for ‘keylib_build_date’
keylib.c:257: warning: no previous prototype for ‘keylib_extend’
keylib.c: In function ‘keylib_new’:
keylib.c:304: warning: pointer targets in passing argument 1 of
‘keylib_bintohex’ differ in signedness
keylib.h:318: note: expected ‘char *’ but argument is of type
‘unsigned char *’
keylib.c: At top level:
keylib.c:307: warning: no previous prototype for ‘keylib_host_trim’
keylib.c:315: warning: no previous prototype for ‘keylib_host_new’
keylib.c: In function ‘keylib_check’:
keylib.c:345: warning: left-hand operand of comma expression has no effect
keylib.c: In function ‘keylib_decode’:
keylib.c:393: warning: pointer targets in passing argument 1 of
‘keylib_unpack’ differ in signedness
keylib.h:312: note: expected ‘unsigned char *’ but argument is
of type ‘char *’
keylib.c: In function ‘keylib_host’:
keylib.c:574: warning: pointer targets in passing argument 1 of
‘keylib_crc’ differ in signedness
keylib.h:324: note: expected ‘unsigned char *’ but argument is
of type ‘char *’
keylib.c: In function ‘keylib_ask_install’:
keylib.c:760: warning: too many arguments for format
keylib.c: At top level:
keylib.c:1011: warning: no previous prototype for ‘keylib_write_fail’
keylib.c:1030: warning: no previous prototype for ‘keylib_get_fail’
keylib.c:1050: warning: no previous prototype for ‘keylib_temp_file’
keylib.c: In function ‘keylib_check_file’:
keylib.c:1081: warning: unused variable ‘prodid’
keylib.c: In function ‘keylib_idle’:
keylib.c:1202: warning: format ‘%d’ expects type ‘int’, but
argument 3 has type ‘time_t’
keylib.c: At top level:
keylib.c:1451: warning: no previous prototype for ‘kkk_close_on_exec’
keylib.c:1522: warning: no previous prototype for ‘kkk_dupaccept’
keylib.c: In function ‘kkk_dupaccept’:
keylib.c:1526: warning: pointer targets in passing argument 3 of
‘accept’ differ in signedness
/usr/include/sys/socket.h:214: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: At top level:
keylib.c:1533: warning: no previous prototype for ‘kkk_dupsocket’
keylib.c: In function ‘kkk_dupsocket’:
keylib.c:1536: warning: unused variable ‘r’
keylib.c:1535: warning: unused variable ‘sock2’
keylib.c: At top level:
keylib.c:1623: warning: no previous prototype for ‘kkk_isip’
keylib.c: In function ‘kkk_lookup’:
keylib.c:1665: error: ‘struct hostent’ has no member named ‘h_addr’
keylib.c:1646: warning: unused variable ‘optval’
keylib.c:1642: warning: unused variable ‘dontblock’
keylib.c: At top level:
keylib.c:1671: warning: no previous prototype for ‘kkk_open_raw’
keylib.c: In function ‘kkk_open_raw’:
keylib.c:1707: error: ‘struct hostent’ has no member named ‘h_addr’
keylib.c:1684: warning: unused variable ‘optval’
keylib.c:1678: warning: unused variable ‘dontblock’
keylib.c: At top level:
keylib.c:1855: warning: no previous prototype for ‘kkk_read_log’
keylib.c:1880: warning: no previous prototype for ‘kkk_socket_write’
keylib.c:1929: warning: no previous prototype for ‘kkk_read_timed_raw’
keylib.c:1966: warning: no previous prototype for ‘kkk_find_dot’
keylib.c: In function ‘kkk_readbf’:
keylib.c:2131: warning: unused variable ‘loop’
keylib.c: In function ‘kkk_readline_big’:
keylib.c:2217: warning: implicit declaration of function ‘strdup’
keylib.c:2217: warning: assignment makes pointer from integer without a cast
keylib.c: In function ‘kkk_wait_write’:
keylib.c:2253: warning: pointer targets in passing argument 5 of
‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_getip’:
keylib.c:2409: warning: pointer targets in passing argument 3 of
‘getpeername’ differ in signedness
/usr/include/sys/socket.h:133: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_getip_raw’:
keylib.c:2428: warning: pointer targets in passing argument 3 of
‘getpeername’ differ in signedness
/usr/include/sys/socket.h:133: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_getmyip’:
keylib.c:2449: warning: pointer targets in passing argument 3 of
‘getsockname’ differ in signedness
/usr/include/sys/socket.h:119: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_getmyip_raw’:
keylib.c:2467: warning: pointer targets in passing argument 3 of
‘getsockname’ differ in signedness
/usr/include/sys/socket.h:119: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_getports’:
keylib.c:2482: warning: pointer targets in passing argument 3 of
‘getpeername’ differ in signedness
/usr/include/sys/socket.h:133: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c:2491: warning: pointer targets in passing argument 3 of
‘getsockname’ differ in signedness
/usr/include/sys/socket.h:119: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_getport’:
keylib.c:2511: warning: pointer targets in passing argument 3 of
‘getsockname’ differ in signedness
/usr/include/sys/socket.h:119: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_nodelay’:
keylib.c:2529: warning: unused variable ‘on’
keylib.c: In function ‘kkk_setrcvbf_raw’:
keylib.c:2554: warning: pointer targets in passing argument 5 of
‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c:2559: warning: pointer targets in passing argument 5 of
‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_hostname’:
keylib.c:2569: warning: implicit declaration of function ‘gethostname’
keylib.c: At top level:
keylib.c:2597: warning: no previous prototype for ‘kkk_setsndbf_raw’
keylib.c: In function ‘kkk_setsndbf_raw’:
keylib.c:2604: warning: pointer targets in passing argument 5 of
‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c:2609: warning: pointer targets in passing argument 5 of
‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190: note: expected ‘socklen_t * restrict’
but argument is of type ‘int *’
keylib.c: In function ‘kkk_error’:
keylib.c:2666: warning: unused variable ‘err’
keylib.c: At top level:
keylib.c:2846: warning: no previous prototype for ‘kkk_lib_usleep’
keylib.c: In function ‘kkk_lib_usleep’:
keylib.c:2849: error: storage size of ‘rqtp’ isn’t known
keylib.c:2852: warning: implicit declaration of function ‘nanosleep’
keylib.c:2849: warning: unused variable ‘rqtp’
make: *** [keylib.o] Fout 1
 
J

James Kuyper

Op 14-6-2012 14:47, James Kuyper schreef: ....

make output

[Lots of warnings snipped]
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o keylib.o
keylib.c

[Lots more warnings snipped]
keylib.c:1665: error: ‘struct hostent’ has no member named ‘h_addr’
[Lots more warnings and error messages snipped]

I did indicate that using all of my recommended options would increase
the amount of cleanup work you'd have to do to get this code working.

Everything I'm about to say is specific to my system, which seems to be
sufficiently similar to yours to allow such comments. That error message
is a consequence of turning on -std=c99, which turns on __STRICT_ANSI,
In /usr/include/features.h, that prevents _BSD_SOURCE or _SVID_SOURCE
from being #defined, with the result that __USE_MISC is also not #defined.

netdb.h contains the following lines:
#include <features.h> ....
#if defined __USE_MISC || defined __USE_GNU
# define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
#endif

Note that according to the C standard, you're allowed to use an h_addr
as an ordinary identifier: you can use it as a function, variable, or
typedef name, as a struct, union, or enumeration tag, as an enumerator
or as a label. None of those uses will work properly if __USE_MISC or
__USE_GNU is #defined, which is why __STRICT_ANSI turns them off. If I
compile with -std=gnu99, all of the error messages disappear; that
should probably work on your system too.

I strongly recommend that you compile with -std=c99, and fix the code so
as to avoid all of the error and warning messages - but I doubt that
your C skills are up to that task. If you don't fix the code, I wouldn't
recommend executing it. That long list of warning messages includes some
very disturbing ones.
 
B

Barry

Op 15-6-2012 13:56, James Kuyper schreef:
Op 14-6-2012 14:47, James Kuyper schreef: ...

make output

[Lots of warnings snipped]
cc -Disunix -D_SVID_OBJECT -std=c99 -pedantic -Wall -Wpointer-arith
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -c -o keylib.o
keylib.c

[Lots more warnings snipped]
keylib.c:1665: error: ‘struct hostent’ has no member named ‘h_addr’
[Lots more warnings and error messages snipped]

I did indicate that using all of my recommended options would increase
the amount of cleanup work you'd have to do to get this code working.

Everything I'm about to say is specific to my system, which seems to be
sufficiently similar to yours to allow such comments. That error message
is a consequence of turning on -std=c99, which turns on __STRICT_ANSI,
In /usr/include/features.h, that prevents _BSD_SOURCE or _SVID_SOURCE
from being #defined, with the result that __USE_MISC is also not #defined.

netdb.h contains the following lines:
#include<features.h> ...
#if defined __USE_MISC || defined __USE_GNU
# define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
#endif

Note that according to the C standard, you're allowed to use an h_addr
as an ordinary identifier: you can use it as a function, variable, or
typedef name, as a struct, union, or enumeration tag, as an enumerator
or as a label. None of those uses will work properly if __USE_MISC or
__USE_GNU is #defined, which is why __STRICT_ANSI turns them off. If I
compile with -std=gnu99, all of the error messages disappear; that
should probably work on your system too.

I strongly recommend that you compile with -std=c99, and fix the code so
as to avoid all of the error and warning messages - but I doubt that
your C skills are up to that task. If you don't fix the code, I wouldn't
recommend executing it. That long list of warning messages includes some
very disturbing ones.

Hello James

thanks for the effort
You're right, my only programming experience is gw-basic :-D
it amazed me that netwin produces such sloppy code.
so there is no way to compile a good dnewsweb program?

Barry


and when I compile the code this makefile

#---- Beginning of Makefile ----

LDLIBS = -lm



CFLAGS = -Disunix -Dunix -D_GNU_SOURCE -std=c99 -Wall -W

dnewsweb: chan_dmy.o conf_dmy.o decode.o dnewsdmy.o dnewsweb.o \
keylib.o lib.o lprintf.o memdebug.o mime64.o nntp.o parsedate.o \
sary.o uuencode.o web_mem.o web_str.o wild.o

#------- End of Makefile -------


i get a program 369kb the original binary file dnewsweb is 800Kb??

Barry
 
J

James Kuyper

On 06/15/2012 02:31 PM, Barry wrote:
....
You're right, my only programming experience is gw-basic :-D
it amazed me that netwin produces such sloppy code.

Most code is sloppy, and my standards are a little higher than most.
Other people with comparably high standards may still have different
standards than I do, and therefore would find much to criticize even in
my own code.

Still - it's been a long time since I've seen that many warnings
produced that small a body of code.
so there is no way to compile a good dnewsweb program?
....

Find something else more modern that serves the same purpose? NetWin's
own web site recommends SurgeNews over DNewsWeb.
and when I compile the code this makefile

#---- Beginning of Makefile ----

LDLIBS = -lm



CFLAGS = -Disunix -Dunix -D_GNU_SOURCE -std=c99 -Wall -W

dnewsweb: chan_dmy.o conf_dmy.o decode.o dnewsdmy.o dnewsweb.o \
keylib.o lib.o lprintf.o memdebug.o mime64.o nntp.o parsedate.o \
sary.o uuencode.o web_mem.o web_str.o wild.o

#------- End of Makefile -------


i get a program 369kb the original binary file dnewsweb is 800Kb??

It's very nearly pointless to compare binary file sizes unless you know
that the same compilers and the same command line options were used.
Also, I dropped the unixbf.c module; that probably reduced the binary
size a bit.
 
B

Barry

Op 15-6-2012 20:58, James Kuyper schreef:
On 06/15/2012 02:31 PM, Barry wrote:
...

Most code is sloppy, and my standards are a little higher than most.
Other people with comparably high standards may still have different
standards than I do, and therefore would find much to criticize even in
my own code.

Still - it's been a long time since I've seen that many warnings
produced that small a body of code.

...

Find something else more modern that serves the same purpose? NetWin's
own web site recommends SurgeNews over DNewsWeb.


It's very nearly pointless to compare binary file sizes unless you know
that the same compilers and the same command line options were used.
Also, I dropped the unixbf.c module; that probably reduced the binary
size a bit.


I know there are better programs than dnewsweb but i like it very much.


what does unixbf.c do , it is important for the program?


and by the way I think you are a very good programmer my respect and
thanks for all effort.

Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top