[m-dev.] Changes to mercury/runtime

Fergus Henderson fjh at cs.mu.oz.au
Wed Feb 12 14:56:44 AEDT 1997

Bert Thompson, you wrote:
> |Bert wrote:
> |> If you have any suggestions on the coding standard or don't want
> |> me to hit all the code immediately, speak now or forever hold 
> |> your peace. 8^)
> |
> |I don't think we should export or even use struct, union, or enum tags.
> |All structs, unions and enums should be without tag, and should be referred
> |to by a typedef'd name. The only exceptions should be structs etc whose
> |declarations we have no control over, e.g. struct stat.
> I agree. Any differing opinions?

Yes, I differ.  There is a significant difference in C between typedefs
and structs: you can forward declare a struct, but you can't forward
declare a typedef.  The capability to forward declare things can come
in useful sometimes, e.g. to avoid circular dependencies between header

> |The indentations on the if statements in 5.1 and 5.2.1 are inconsistent.
> I'll fix that up.

I think you should fix it by blessing what is there.

> It is currently:
>         if (this_is_a_somewhat_long_conditional_test(
>                 in_the_condition_of_an +
>                 if_then))
>         {
>                 /*...*/
>         }
> I'll change to:
>         if (this_is_a_somewhat_long_conditional_test(
>         	        in_the_condition_of_an +
>                		if_then)) {
>                 /*...*/
>         }

Please don't.  Please change the standard to require the open curly
brace to be on a line of its own for the case when it would otherwise
go on a continuation line.

Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at         |     -- the last words of T. S. Garp.

More information about the developers mailing list