Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!aplcen!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: const and struct pointers Message-ID: <12244@smoke.BRL.MIL> Date: 27 Feb 90 19:09:54 GMT References: <1214@watserv1.waterloo.edu> <12570046@hpclwjm.HP.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <12570046@hpclwjm.HP.COM> walter@hpclwjm.HP.COM (Walter Murray) writes: >But in the posted example, the argument and parameter are structures, >not pointers. It seems to me that the code is legal. Thanks for posting the original example, which I had misremembered as passing a pointer, not the actual struct. Of course you're right that a qualified struct can be passed to a function expecting an unqualified struct, because the argument is assignment-compatible (meaning: 3.3.16.1 Constraints are met) with the parameter type, once the qualifier is stripped as per 3.2.2.1, as footnote 48 in the December 1988 draft reminds us. It's easy to see how an implementor could miss that, by not taking literally the requirement that argument passing be as if by simple assignment.