Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!usc!ucsd!ucsdhub!hp-sdd!hplabs!hp-ses!hpcuhb!hpcllla!hpclisp!hpclwjm!walter From: walter@hpclwjm.HP.COM (Walter Murray) Newsgroups: comp.std.c Subject: Re: const and struct pointers Message-ID: <12570046@hpclwjm.HP.COM> Date: 26 Feb 90 18:17:33 GMT References: <1214@watserv1.waterloo.edu> Organization: Hewlett-Packard Calif. Language Lab Lines: 27 Robert Adsett: > #include > struct qwert { int a; double b;}; > void asdf( struct qwert a); > const double a = 3.0; > void junk( const double *b, const struct qwert *c) > { > (void)exp(a); /* Works */ > (void)exp(*b); /* Works */ > asdf( *c); /* Type mismatch ???? */ > } > The compiler gives a type mismatch in argument error for the line > indicated. Doug Gwyn: > The compiler was correct to complain about an argument that had as its > type "pointer to qualified type" being passed to a function expecting > a pointer to an unqualified type. But in the posted example, the argument and parameter are structures, not pointers. It seems to me that the code is legal. Walter Murray ----------