|
160 | 160 | print OUT_FILE "{\n"; |
161 | 161 | file_to_hex($fname); |
162 | 162 | print OUT_FILE "};\n"; |
163 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 163 | + |
| 164 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 165 | + # compile-time constant expression when used in a static initializer. |
| 166 | + # So don't use `static const int sizeof_` here: |
| 167 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
164 | 168 | } |
165 | 169 | print OUT_FILE "#endif /* USE_CERT_BUFFERS_1024 */\n\n"; |
166 | 170 |
|
|
177 | 181 | print OUT_FILE "{\n"; |
178 | 182 | file_to_hex($fname); |
179 | 183 | print OUT_FILE "};\n"; |
180 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 184 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 185 | + # compile-time constant expression when used in a static initializer. |
| 186 | + # So don't use `static const int sizeof_` here: |
| 187 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
181 | 188 | } |
182 | 189 |
|
183 | 190 |
|
|
196 | 203 | print OUT_FILE "{\n"; |
197 | 204 | file_to_hex($fname); |
198 | 205 | print OUT_FILE "};\n"; |
199 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 206 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 207 | + # compile-time constant expression when used in a static initializer. |
| 208 | + # So don't use `static const int sizeof_` here: |
| 209 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
200 | 210 | } |
201 | 211 |
|
202 | 212 | print OUT_FILE "#endif /* USE_CERT_BUFFERS_3072 */\n\n"; |
|
214 | 224 | print OUT_FILE "{\n"; |
215 | 225 | file_to_hex($fname); |
216 | 226 | print OUT_FILE "};\n"; |
217 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 227 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 228 | + # compile-time constant expression when used in a static initializer. |
| 229 | + # So don't use `static const int sizeof_` here: |
| 230 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
218 | 231 | } |
219 | 232 |
|
220 | 233 | print OUT_FILE "#endif /* USE_CERT_BUFFERS_4096 */\n\n"; |
|
231 | 244 | print OUT_FILE "{\n"; |
232 | 245 | file_to_hex($fname); |
233 | 246 | print OUT_FILE "};\n"; |
234 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 247 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 248 | + # compile-time constant expression when used in a static initializer. |
| 249 | + # So don't use `static const int sizeof_` here: |
| 250 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
235 | 251 | } |
236 | 252 |
|
237 | 253 | print OUT_FILE "#endif /* HAVE_FALCON */\n\n"; |
|
500 | 516 | 0x12, 0xea, 0xc1, 0x94, 0x37, 0xa0, 0x11, 0xff, 0xb2, 0xa4, |
501 | 517 | 0xc3, 0x61, 0xf2, 0xa3, 0x49, 0xbe, 0xe7, 0xb6, 0x96, 0x2f, |
502 | 518 | }; |
503 | | -static const int sizeof_bench_dilithium_level2_key = sizeof(bench_dilithium_level2_key); |
| 519 | +#define sizeof_bench_dilithium_level2_key (sizeof(bench_dilithium_level2_key)) |
504 | 520 |
|
505 | 521 | #endif /* !WOLFSSL_DILITHIUM_NO_SIGN */ |
506 | 522 |
|
|
642 | 658 | 0x36, 0x8b, 0x81, 0x26, 0x99, 0x92, 0x42, 0xda, 0x45, 0xb1, |
643 | 659 | 0xfe, 0x4b, |
644 | 660 | }; |
645 | | -static const int sizeof_bench_dilithium_level2_pubkey = |
646 | | - sizeof(bench_dilithium_level2_pubkey); |
| 661 | +#define sizeof_bench_dilithium_level2_pubkey \\ |
| 662 | + (sizeof(bench_dilithium_level2_pubkey)) |
647 | 663 |
|
648 | 664 | #endif /* !WOLFSSL_DILITHIUM_NO_VERIFY */ |
649 | 665 |
|
|
1057 | 1073 | 0xd2, 0x71, 0xb2, 0x5e, 0xae, 0x72, 0xc9, 0x69, 0x3b, 0x80, |
1058 | 1074 | 0xc2, 0x27, |
1059 | 1075 | }; |
1060 | | -static const int sizeof_bench_dilithium_level3_key = sizeof(bench_dilithium_level3_key); |
| 1076 | +#define sizeof_bench_dilithium_level3_key (sizeof(bench_dilithium_level3_key)) |
1061 | 1077 |
|
1062 | 1078 | #endif /* !WOLFSSL_DILITHIUM_NO_SIGN */ |
1063 | 1079 |
|
|
1764 | 1780 | 0x15, 0xed, 0xa6, 0x86, 0x8f, 0x2f, 0xe5, 0x67, 0x0f, 0xdd, |
1765 | 1781 | 0xbf, 0x70, 0x53, 0xaa, 0x9b, 0x74, |
1766 | 1782 | }; |
1767 | | -static const int sizeof_bench_dilithium_level5_key = sizeof(bench_dilithium_level5_key); |
| 1783 | +#define sizeof_bench_dilithium_level5_key (sizeof(bench_dilithium_level5_key)) |
1768 | 1784 |
|
1769 | 1785 | #endif /* !WOLFSSL_DILITHIUM_NO_SIGN */ |
1770 | 1786 |
|
|
2034 | 2050 | 0xe9, 0x0e, 0x42, 0xdd, 0x17, 0xd7, 0x6e, 0x19, 0x8d, 0x95, |
2035 | 2051 | 0x0a, 0x93, |
2036 | 2052 | }; |
2037 | | -static const int sizeof_bench_dilithium_level5_pubkey = |
2038 | | - sizeof(bench_dilithium_level5_pubkey); |
| 2053 | +#define sizeof_bench_dilithium_level5_pubkey \\ |
| 2054 | + (sizeof(bench_dilithium_level5_pubkey)) |
2039 | 2055 |
|
2040 | 2056 | #endif /* !WOLFSSL_DILITHIUM_NO_VERIFY */ |
2041 | 2057 |
|
|
2055 | 2071 | print OUT_FILE "{\n"; |
2056 | 2072 | file_to_hex($fname); |
2057 | 2073 | print OUT_FILE "};\n"; |
2058 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 2074 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 2075 | + # compile-time constant expression when used in a static initializer. |
| 2076 | + # So don't use `static const int sizeof_` here: |
| 2077 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
2059 | 2078 | } |
2060 | 2079 |
|
2061 | 2080 | print OUT_FILE "#endif /* HAVE_SPHINCS */\n\n"; |
|
2072 | 2091 | print OUT_FILE "{\n"; |
2073 | 2092 | file_to_hex($fname); |
2074 | 2093 | print OUT_FILE "};\n"; |
2075 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 2094 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 2095 | + # compile-time constant expression when used in a static initializer. |
| 2096 | + # So don't use `static const int sizeof_` here: |
| 2097 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
2076 | 2098 | } |
2077 | 2099 | print OUT_FILE "#endif /* HAVE_ECC && USE_CERT_BUFFERS_256 */\n\n"; |
2078 | 2100 |
|
|
2147 | 2169 | print OUT_FILE "{\n"; |
2148 | 2170 | file_to_hex($fname); |
2149 | 2171 | print OUT_FILE "};\n"; |
2150 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 2172 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 2173 | + # compile-time constant expression when used in a static initializer. |
| 2174 | + # So don't use `static const int sizeof_` here: |
| 2175 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
2151 | 2176 | } |
2152 | 2177 | print OUT_FILE "#endif /* HAVE_ED25519 */\n\n"; |
2153 | 2178 |
|
|
2164 | 2189 | print OUT_FILE "{\n"; |
2165 | 2190 | file_to_hex($fname); |
2166 | 2191 | print OUT_FILE "};\n"; |
2167 | | - print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n"; |
| 2192 | + # In C89/C90 (which Watcom generally defaults to), sizeof must be a |
| 2193 | + # compile-time constant expression when used in a static initializer. |
| 2194 | + # So don't use `static const int sizeof_` here: |
| 2195 | + print OUT_FILE "#define sizeof_$sname (sizeof($sname))\n\n" |
2168 | 2196 | } |
2169 | 2197 | print OUT_FILE "#endif /* USE_CERT_BUFFERS_25519 */\n\n"; |
2170 | 2198 |
|
|
0 commit comments