Re: turning Marsaglia's recent posts into a function
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Thu, 02 Sep 2010 11:38:16 +1200
On 09/ 2/10 11:08 AM, Uno wrote:
Ian Collins wrote:On 09/ 1/10 12:42 PM, Uno wrote:
$ gcc -Wall -Wextra geo1.c -o out
geo1.c: In function ‘MWC’:
geo1.c:5: warning: type defaults to ‘int’ in declaration of ‘c’
geo1.c:5: warning: type defaults to ‘int’ in declaration of ‘j’
geo1.c:5: warning: unused variable ‘i’
geo1.c: In function ‘main’:
geo1.c:21: warning: format ‘%22u’ expects type ‘unsigned int’, but
argument 2 has type ‘long unsigned int’
geo1.c:23: warning: format ‘%22u’ expects type ‘unsigned int’, but
argument 2 has type ‘long unsigned int’
geo1.c:24: warning: control reaches end of non-void function
A list of compiler warnings for some truly awful code.
These things look very fixable to me. George is 86, so he remembers a
more traditional C and has forgotten more about making random numbers
than we'll ever know.
I don't think he reads clc, but do you think your tone appropriate?
Yes.
unsigned long t,x,i; static c=0,j=4691;
is an abomination.
Passing the wrong types to printf is a bug.
--
Ian Collins
.
- Follow-Ups:
- Re: turning Marsaglia's recent posts into a function
- From: christian.bau
- Re: turning Marsaglia's recent posts into a function
- References:
- Re: turning Marsaglia's recent posts into a function
- From: Ian Collins
- Re: turning Marsaglia's recent posts into a function
- From: Uno
- Re: turning Marsaglia's recent posts into a function
- Prev by Date: Re: turning Marsaglia's recent posts into a function
- Next by Date: Re: turning Marsaglia's recent posts into a function
- Previous by thread: Re: turning Marsaglia's recent posts into a function
- Next by thread: Re: turning Marsaglia's recent posts into a function
- Index(es):
Relevant Pages
|