Re: Is it possible to make void * safer?



websnarf@xxxxxxxxx wrote:

Will generate warnings for x.push( &array, &f );


Have you tried it? After adding in a return 0; MSVC 6.0 says there are
no problems at its highest warning level.

Well it should. That's a rather old and non-compliant compiler.

Sun cc (normal warnings) gives:

"/tmp/x.c", line 28: warning: argument #2 is incompatible with prototype:
prototype: pointer to int : "unknown", line 0
argument : pointer to float

gcc (normal warnings) gives:

/tmp/x.c: In function `main':
/tmp/x.c:28: warning: passing arg 2 of pointer to function from incompatible pointer type

--
Ian Collins.
.



Relevant Pages

  • Re: [PATCH] [0/9] Use 64bit x86 machine check code for 32bit too
    ... warning: passing argument 2 of ‘strict_strtoull’ makes integer from pointer without a cast ...
    (Linux-Kernel)
  • DBD::ODBC compile problem from v1.00 to 1.09 on RH73
    ... Warning: LD_LIBRARY_PATH doesn't include /usr ... dbdimp.c:162: warning: passing arg 1 of `fprintf' makes pointer from ... integer without a cast ...
    (perl.dbi.users)
  • Re: 2.6.9-rc1-mm5
    ... drivers/net/starfire.c:924: warning: passing arg 1 of `readb' makes pointer from integer without a cast ...
    (Linux-Kernel)
  • cannot install p5-Apache-SubProcess on freeBSD 5.4
    ... mod_perl.c:235: error: syntax error before ')' token ... mod_perl.c:781: warning: passing arg 1 of `Perl_newSVpv' makes pointer from integer without a cast ...
    (freebsd-questions)
  • Re: Arrays issue
    ... x.c:158: warning: format argument is not a pointer ... size NAMESIZE) of "char". ... encountered a service with extra aliases, ... It happens to be an object of type "pointer to pointer to char" ...
    (comp.lang.c)