Re: XWisp2 with gcc patch

Rob Hamerling <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
Helo Daniël,

I have read your patches for xwisp2, and have some comments/questions.
Please have some patience with me, I have hardly any experience with 
using Linux and even less with programming for Linux... On my Linux on 
my notebook (SuSE 9.3) there is no GCC installed, I'll see if I can find 
and install it!

Daniel Serpell wrote:

> xwisp2.170.linux.unwarn.patch :
>         This fixes some of the warnings on the code. This is not
>         complete, and some of the casts are really important if you
>         want xwisp2 to work under 64bit arches.

If not complete, what would be missing?

> +#if !defined(__LINUX__) && !defined(__linux)

May I suppose that '__linux' is defined by the Linux flavour of GCC?

> -#include <sys\types.h>
> -#include <sys\stat.h>

The forward- in stead of back-slash works for the Open Watcom C compiler 
and for the IBM Visual Age C compiler under OS/2 too! So I can safely 
change that!

> +  #define _searchenv(a,b,c) (*c=0)

Is there no _searchenv() functionality in Linux?


> -    sprintf(szBuffer, "WbusNext failed, rc %lu", rc);
> +    sprintf(szBuffer, "WbusNext failed, rc %lu", (unsigned long)rc);

When 'rc' is declared as 'int', wouldn't is be better to use:
   sprintf(szBuffer, "WbusNext failed, rc %d", rc);



> -extern int main(int argc, unsigned char **argv) {
> +extern int main(int argc, char **argv) {

I never understood the difference between a pointer to a signed or 
unsigned character, unless there are to me unknown architectures which 
have a different length for these. Never mind.....

Regards, Rob.


-- 
Rob Hamerling, Vianen, NL phone +31-347-322822
homepage: http://www.robh.nl/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.