Makefile Linux

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 ;-)

Advertisements

On 13 jun, 00:32, Barry <> wrote:
> 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 ;-)

Advertisements

On 06/12/2012 06:32 PM, Barry wrote:
> 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.
--
James Kuyper

Op 13-6-2012 13:02, James Kuyper schreef:
> On 06/12/2012 06:32 PM, Barry wrote:
>> 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.

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.
--
James Kuyper

Op 13-6-2012 15:36, James Kuyper schreef:
> 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.

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".

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking

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".
>
> S
>
no I got it from them.

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.
--
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.
--
James Kuyper

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

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking

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

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:

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.
--
James Kuyper

Op 14-6-2012 4:30, James Kuyper schreef:
> 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.

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.

Op 14-6-2012 14:47, James Kuyper schreef:
> 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.

Op 14-6-2012 14:47, James Kuyper schreef:
> 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.

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

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

Op 15-6-2012 13:56, James Kuyper schreef:
> 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 :-D
it amazed me that netwin produces such sloppy code.
so there is no way to compile a good dnewsweb program?

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?
....

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.

Op 15-6-2012 20:58, James Kuyper schreef:
> 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.

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.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!