[m-dev.] Changes to mercury/runtime

Bert Thompson aet at cs.mu.oz.au
Wed Feb 12 16:00:02 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
|files.

I don't understand what you mean. Can you provide a concrete example?

|> |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.

Sure. (I used that layout for such cases in the code that I hit, anyway.)

|> 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.



More information about the developers mailing list