 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Barry Guest
|
Posted: Thu Jun 14, 2012 12:21 pm Post subject: Re: Makefile Linux |
|
|
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
|
Posted: Fri Jun 15, 2012 9:56 am Post subject: Re: Makefile Linux |
|
|
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
|
Posted: Fri Jun 15, 2012 4:31 pm Post subject: Re: Makefile Linux |
|
|
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
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
|
Posted: Fri Jun 15, 2012 4:58 pm Post subject: Re: Makefile Linux |
|
|
On 06/15/2012 02:31 PM, Barry wrote:
....
| Quote: | You're right, my only programming experience is gw-basic
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
|
Posted: Fri Jun 15, 2012 5:59 pm Post subject: Re: Makefile Linux |
|
|
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
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
|
Posted: Fri Jun 15, 2012 11:22 pm Post subject: Re: Makefile Linux |
|
|
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
|
Posted: Tue Aug 14, 2012 6:36 am Post subject: Re: Makefile Linux |
|
|
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
|
Posted: Tue Aug 14, 2012 5:23 pm Post subject: Re: Makefile Linux |
|
|
On Tue, 2012-08-14, lovecreatesbeauty wrote:
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
|
Posted: Tue Sep 04, 2012 7:31 pm Post subject: Re: Makefile Linux |
|
|
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
|
Posted: Thu Sep 06, 2012 11:58 am Post subject: Re: Makefile Linux |
|
|
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 |
|
 |
Powered by phpBB © 2001, 2006 phpBB Group
|