Fossil SCM
Correct recent makeheaders.html documentation update to respect the prohibition of multiple global variables per declaration
Commit
ba5ab70e96ca7e25d6c4fb3c164f221f347508cf
Parent
e7bdbbe435556a7…
1 file changed
+22
-20
+22
-20
| --- src/makeheaders.html | ||
| +++ src/makeheaders.html | ||
| @@ -931,30 +931,10 @@ | ||
| 931 | 931 | become very confused if it encounters an old K&R function. |
| 932 | 932 | Therefore you should take care to avoid putting K&R function definitions |
| 933 | 933 | in your code. |
| 934 | 934 | </p> |
| 935 | 935 | |
| 936 | -<p> | |
| 937 | -Makeheaders does not support defining an enumerated or aggregate type in | |
| 938 | -the same statement as a variable declaration. None of the following | |
| 939 | -statements work completely: | |
| 940 | -<pre> | |
| 941 | -struct {int field;} a; | |
| 942 | -struct Tag {int field;} b; | |
| 943 | -struct Tag c; | |
| 944 | -</pre> | |
| 945 | -Instead, define types separately from variables: | |
| 946 | -<pre> | |
| 947 | -#if INTERFACE | |
| 948 | -struct Tag {int field;}; | |
| 949 | -#endif | |
| 950 | -Tag b, c; | |
| 951 | -</pre> | |
| 952 | -See <a href="#H0008">3.2 What Declarations Get Copied</a> for details, | |
| 953 | -including on the automatic typedef. | |
| 954 | -</p> | |
| 955 | - | |
| 956 | 936 | <p> |
| 957 | 937 | Makeheaders does not understand when you define more than one |
| 958 | 938 | global variable with the same type separated by a comma. |
| 959 | 939 | In other words, makeheaders does not understand this: |
| 960 | 940 | <pre> |
| @@ -971,10 +951,32 @@ | ||
| 971 | 951 | Since global variables ought to be exceedingly rare, and since it is |
| 972 | 952 | good style to declare them separately anyhow, this restriction is |
| 973 | 953 | not seen as a terrible hardship. |
| 974 | 954 | </p> |
| 975 | 955 | |
| 956 | +<p> | |
| 957 | +Makeheaders does not support defining an enumerated or aggregate type in | |
| 958 | +the same statement as a variable declaration. None of the following | |
| 959 | +statements work completely: | |
| 960 | +<pre> | |
| 961 | +struct {int field;} a; | |
| 962 | +struct Tag {int field;} b; | |
| 963 | +struct Tag c; | |
| 964 | +</pre> | |
| 965 | +Instead, define types separately from variables: | |
| 966 | +<pre> | |
| 967 | +#if INTERFACE | |
| 968 | +struct Tag {int field;}; | |
| 969 | +#endif | |
| 970 | +Tag a; | |
| 971 | +Tag b; /* No more than one variable per declaration. */ | |
| 972 | +Tag c; /* So must put each on its own line. */ | |
| 973 | +</pre> | |
| 974 | +See <a href="#H0008">3.2 What Declarations Get Copied</a> for details, | |
| 975 | +including on the automatic typedef. | |
| 976 | +</p> | |
| 977 | + | |
| 976 | 978 | <p> |
| 977 | 979 | The makeheaders program processes its source file prior to sending |
| 978 | 980 | those files through the C preprocessor. |
| 979 | 981 | Hence, if you hide important structure information in preprocessor defines, |
| 980 | 982 | makeheaders might not be able to successfully extract the information |
| 981 | 983 |
| --- src/makeheaders.html | |
| +++ src/makeheaders.html | |
| @@ -931,30 +931,10 @@ | |
| 931 | become very confused if it encounters an old K&R function. |
| 932 | Therefore you should take care to avoid putting K&R function definitions |
| 933 | in your code. |
| 934 | </p> |
| 935 | |
| 936 | <p> |
| 937 | Makeheaders does not support defining an enumerated or aggregate type in |
| 938 | the same statement as a variable declaration. None of the following |
| 939 | statements work completely: |
| 940 | <pre> |
| 941 | struct {int field;} a; |
| 942 | struct Tag {int field;} b; |
| 943 | struct Tag c; |
| 944 | </pre> |
| 945 | Instead, define types separately from variables: |
| 946 | <pre> |
| 947 | #if INTERFACE |
| 948 | struct Tag {int field;}; |
| 949 | #endif |
| 950 | Tag b, c; |
| 951 | </pre> |
| 952 | See <a href="#H0008">3.2 What Declarations Get Copied</a> for details, |
| 953 | including on the automatic typedef. |
| 954 | </p> |
| 955 | |
| 956 | <p> |
| 957 | Makeheaders does not understand when you define more than one |
| 958 | global variable with the same type separated by a comma. |
| 959 | In other words, makeheaders does not understand this: |
| 960 | <pre> |
| @@ -971,10 +951,32 @@ | |
| 971 | Since global variables ought to be exceedingly rare, and since it is |
| 972 | good style to declare them separately anyhow, this restriction is |
| 973 | not seen as a terrible hardship. |
| 974 | </p> |
| 975 | |
| 976 | <p> |
| 977 | The makeheaders program processes its source file prior to sending |
| 978 | those files through the C preprocessor. |
| 979 | Hence, if you hide important structure information in preprocessor defines, |
| 980 | makeheaders might not be able to successfully extract the information |
| 981 |
| --- src/makeheaders.html | |
| +++ src/makeheaders.html | |
| @@ -931,30 +931,10 @@ | |
| 931 | become very confused if it encounters an old K&R function. |
| 932 | Therefore you should take care to avoid putting K&R function definitions |
| 933 | in your code. |
| 934 | </p> |
| 935 | |
| 936 | <p> |
| 937 | Makeheaders does not understand when you define more than one |
| 938 | global variable with the same type separated by a comma. |
| 939 | In other words, makeheaders does not understand this: |
| 940 | <pre> |
| @@ -971,10 +951,32 @@ | |
| 951 | Since global variables ought to be exceedingly rare, and since it is |
| 952 | good style to declare them separately anyhow, this restriction is |
| 953 | not seen as a terrible hardship. |
| 954 | </p> |
| 955 | |
| 956 | <p> |
| 957 | Makeheaders does not support defining an enumerated or aggregate type in |
| 958 | the same statement as a variable declaration. None of the following |
| 959 | statements work completely: |
| 960 | <pre> |
| 961 | struct {int field;} a; |
| 962 | struct Tag {int field;} b; |
| 963 | struct Tag c; |
| 964 | </pre> |
| 965 | Instead, define types separately from variables: |
| 966 | <pre> |
| 967 | #if INTERFACE |
| 968 | struct Tag {int field;}; |
| 969 | #endif |
| 970 | Tag a; |
| 971 | Tag b; /* No more than one variable per declaration. */ |
| 972 | Tag c; /* So must put each on its own line. */ |
| 973 | </pre> |
| 974 | See <a href="#H0008">3.2 What Declarations Get Copied</a> for details, |
| 975 | including on the automatic typedef. |
| 976 | </p> |
| 977 | |
| 978 | <p> |
| 979 | The makeheaders program processes its source file prior to sending |
| 980 | those files through the C preprocessor. |
| 981 | Hence, if you hide important structure information in preprocessor defines, |
| 982 | makeheaders might not be able to successfully extract the information |
| 983 |