C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Makefile Linux
Goto page Previous  1, 2
 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language
View previous topic :: View next topic  
Author Message
Barry
Guest





PostPosted: Thu Jun 14, 2012 12:21 pm    Post subject: Re: Makefile Linux Reply with quote



Op 14-6-2012 14:47, James Kuyper schreef:
Quote:
On 06/14/2012 07:45 AM, Barry wrote:
Op 14-6-2012 5:34, Stephen Sprunk schreef:
On 13-Jun-12 18:40, Barry wrote:
Op 14-6-2012 1:12, Stephen Sprunk schreef:
On 13-Jun-12 07:36, Barry wrote:
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".

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

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.

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
Back to top
James Kuyper
Guest





PostPosted: Fri Jun 15, 2012 9:56 am    Post subject: Re: Makefile Linux Reply with quote



On 06/14/2012 10:21 AM, Barry wrote:
Quote:
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

[Lots of warnings snipped]
Quote:
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]
Quote:
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:
Quote:
#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.
--
James Kuyper
Back to top
Barry
Guest





PostPosted: Fri Jun 15, 2012 4:31 pm    Post subject: Re: Makefile Linux Reply with quote



Op 15-6-2012 13:56, James Kuyper schreef:
Quote:
On 06/14/2012 10:21 AM, Barry wrote:
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

[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 Very Happy
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
Back to top
James Kuyper
Guest





PostPosted: Fri Jun 15, 2012 4:58 pm    Post subject: Re: Makefile Linux Reply with quote

On 06/15/2012 02:31 PM, Barry wrote:
....
Quote:
You're right, my only programming experience is gw-basic Very Happy
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.

Quote:
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.

Quote:
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.
Back to top
Barry
Guest





PostPosted: Fri Jun 15, 2012 5:59 pm    Post subject: Re: Makefile Linux Reply with quote

Op 15-6-2012 20:58, James Kuyper schreef:
Quote:
On 06/15/2012 02:31 PM, Barry wrote:
...
You're right, my only programming experience is gw-basic Very Happy
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.


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
Back to top
James Kuyper
Guest





PostPosted: Fri Jun 15, 2012 11:22 pm    Post subject: Re: Makefile Linux Reply with quote

On 06/15/2012 03:59 PM, Barry wrote:
....
Quote:
what does unixbf.c do , it is important for the program?

It provides alternative, implementations of C standard library functions
such as fopen(), fread(), etc. That kind of thing is, at best, a
dangerous thing to do. However, it doesn't even compile. It uses FSSpec
as if it were a valid type name, despite the complete absence of any
definition for that identifier anywhere in the code.
--
James Kuyper
Back to top
lovecreatesbeauty
Guest





PostPosted: Tue Aug 14, 2012 6:36 am    Post subject: Re: Makefile Linux Reply with quote

On Tuesday, June 12, 2012 10:32:49 PM UTC, Barry wrote:
Quote:
Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it

try this one

http://www.grex.org/~jhl/Visual_Stupid_Makefile.txt
Back to top
Jorgen Grahn
Guest





PostPosted: Tue Aug 14, 2012 5:23 pm    Post subject: Re: Makefile Linux Reply with quote

On Tue, 2012-08-14, lovecreatesbeauty wrote:
Quote:
On Tuesday, June 12, 2012 10:32:49 PM UTC, Barry wrote:
Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it

try this one

http://www.grex.org/~jhl/Visual_Stupid_Makefile.txt

This is kind of offtopic, but ... it has some features I like
(dependency generation) and some I don't like (a split of header files
and .c files into separate directories; too many variables and
wildcards hiding what's really happening).

And I don't understand what's "visual" or "stupid" about it.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Back to top
Phil Carmody
Guest





PostPosted: Tue Sep 04, 2012 7:31 pm    Post subject: Re: Makefile Linux Reply with quote

Jorgen Grahn <grahn+nntp (AT) snipabacken (DOT) se> writes:

Quote:
On Tue, 2012-08-14, lovecreatesbeauty wrote:
On Tuesday, June 12, 2012 10:32:49 PM UTC, Barry wrote:
Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it

try this one

http://www.grex.org/~jhl/Visual_Stupid_Makefile.txt

This is kind of offtopic, but ... it has some features I like
(dependency generation) and some I don't like (a split of header files
and .c files into separate directories; too many variables and
wildcards hiding what's really happening).

And I don't understand what's "visual" or "stupid" about it.

Elsewhere on that site (under ~jhl, obviously):

char *strncpy(char *dst, const char *src, size_t n)
{
char *p = dst;

while (n && (*dst++ = *src++)) n--;
if (!n) *dst = '\0';
return p;
}

Try that with:

char dst[2];
const char src[] = "stupid";
size_t n = sizeof(dst); // n=2
strncpy(dst, src, n); // copies 's', copies 't', breaks loop, writes a \0 - BANG!

Let he who is without stupid cast the first stone.

Phil, who occasionally, fortunately albeit briefly, harnesses the power of stupid.
--
Quote:
I'd argue that there is much evidence for the existence of a God.
Pics or it didn't happen.

-- Tom (/. uid 822)
Back to top
88888 Dihedral
Guest





PostPosted: Thu Sep 06, 2012 11:58 am    Post subject: Re: Makefile Linux Reply with quote

Phil Carmody於 2012年9月5日星期三UTC+8上午5時40分24秒寫道:
Quote:
Jorgen Grahn <grahn+nntp (AT) snipabacken (DOT) se> writes:



On Tue, 2012-08-14, lovecreatesbeauty wrote:

On Tuesday, June 12, 2012 10:32:49 PM UTC, Barry wrote:

Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it



try this one



http://www.grex.org/~jhl/Visual_Stupid_Makefile.txt



This is kind of offtopic, but ... it has some features I like

(dependency generation) and some I don't like (a split of header files

and .c files into separate directories; too many variables and

wildcards hiding what's really happening).



And I don't understand what's "visual" or "stupid" about it.



Elsewhere on that site (under ~jhl, obviously):



char *strncpy(char *dst, const char *src, size_t n)

{

char *p = dst;



while (n && (*dst++ = *src++)) n--;

if (!n) *dst = '\0';

return p;

}

Are dst and srn non-overlapping in the memeory space?

This is a good example in C to teach pointers.


But for a 32-bit cpu a well-tuned memcpy
in assembly is preferred.

Anyway there are 8051, 8052, and 8086 level MCUs on
the markete for applications that focus on cheap parts.



Quote:

Try that with:



char dst[2];

const char src[] = "stupid";

size_t n = sizeof(dst); // n=2

strncpy(dst, src, n); // copies 's', copies 't', breaks loop, writes a \0 - BANG!



Let he who is without stupid cast the first stone.



Phil, who occasionally, fortunately albeit briefly, harnesses the power of stupid.

--

I'd argue that there is much evidence for the existence of a God.

Pics or it didn't happen.

-- Tom (/. uid 822)
Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
 


Powered by phpBB © 2001, 2006 phpBB Group