]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3799] Enable libopts noreturn compiler advice for MSC.
authorDave Hart <hart@ntp.org>
Sat, 11 Mar 2023 08:23:55 +0000 (03:23 -0500)
committerDave Hart <hart@ntp.org>
Sat, 11 Mar 2023 08:23:55 +0000 (03:23 -0500)
Add ChangeLog to ntpd project for easy editing within VS.

bk: 640c3a9bo23uPY1V54Gsc4IKReVTVg

ChangeLog
ports/winnt/vs2015/ntpd/ntpd.vcxproj
ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters
sntp/libopts/autoopts.h
sntp/libopts/autoopts/project.h
sntp/libopts/makeshell.c
sntp/libopts/proto.h
sntp/libopts/usage.c

index 4843f182a050113d113032203055f914c7da4bea..5c279695fed2b2e57fb0066e33846507d479b6c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 ---
 * [Bug 3800] libopts-42.1.17 does not compile with Microsoft C. <hart@ntp.org>
+* [Bug 3799] Enable libopts noreturn compiler advice for MSC. <hart@ntp.org>
 * [Bug 3797] Windows getaddrinfo w/AI_ADDRCONFIG fails for localhost when 
              disconnected, breaking ntpq and ntpdc. <hart@ntp.org>
 * [Bug 3795] pollskewlist documentation uses | when it shouldn't.
index 32636048aef0f7fe13d56387c10301557b696c62..e4e837791eb0034d5c3cf7fc2de973dfb06a5571 100644 (file)
       </AdditionalInputs>
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\version.c;%(Outputs)</Outputs>
     </CustomBuild>
+    <None Include="..\..\..\..\ChangeLog" />
     <None Include="..\..\libntp\MSG00001.bin" />
     <None Include="..\libntp\messages.mc" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index 10bc14fcc7d74ac477f53ddb9efe5117492e21e0..2dcdfd014dca73cfc19e55a287259cda606f4f0d 100644 (file)
     <None Include="..\libntp\messages.mc">
       <Filter>Resource Files</Filter>
     </None>
+    <None Include="..\..\..\..\ChangeLog" />
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\..\..\ntpd\ntp_parser.h">
     </CustomBuild>
     <CustomBuild Include="..\..\..\..\packageinfo.sh" />
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index 36bb43f29d220b37e4135d10add9942906beac65..f7a64f17af05bcaf043c75014da10ffd39283859 100644 (file)
@@ -463,12 +463,12 @@ static char const * program_pkgdatadir   = pkgdatadir_default;
 static tOptionLoadMode option_load_mode  = OPTION_LOAD_UNCOOKED;
 static tePagerState pagerState           = PAGER_STATE_INITIAL;
 
-static noreturn void option_exits(int exit_code);
-static noreturn void fserr_exit(char const * prog, char const * op,
-                                char const * fname);
-static          void fserr_warn(char const * prog, char const * op,
-                                char const * fname);
-static noreturn void ao_bug(char const * msg);
+static lo_noreturn void option_exits(int exit_code);
+static lo_noreturn void fserr_exit(char const * prog, char const * op,
+                                   char const * fname);
+static             void fserr_warn(char const * prog, char const * op,
+                                   char const * fname);
+static lo_noreturn void ao_bug(char const * msg);
 
        FILE *       option_usage_fp      = NULL;
 
index 1f196efa0f92dd83248be1225b332d92d2b94c94..05ebe5e92f87cdfeeb894e846baa169ccad7436c 100644 (file)
@@ -77,5 +77,11 @@ typedef int tSuccess;
 #define MOD_LOCAL static
 #define parse_duration option_parse_duration
 
+#ifdef _MSC_VER
+#define lo_noreturn __declspec(noreturn)
+#else
+#define lo_noreturn noreturn
+#endif
+
 #endif /* AUTOGEN_PROJECT_H */
 /* end of project.h */
index 10ed12005aa7c6e6a4e96dcbd0ed3626dd418e7b..8541c1ff68d9832c93bcbd685f2aa7bab5ef1acb 100644 (file)
@@ -35,7 +35,7 @@
 #define UPPER(_c) (toupper(to_uchar(_c)))
 #define LOWER(_c) (tolower(to_uchar(_c)))
 
-noreturn static void
+lo_noreturn static void
 option_exits(int exit_code)
 {
     if (print_exit)
@@ -43,7 +43,7 @@ option_exits(int exit_code)
     exit(exit_code);
 }
 
-noreturn static void
+lo_noreturn static void
 ao_bug(char const * msg)
 {
     fprintf(stderr, zao_bug_msg, msg);
@@ -57,7 +57,7 @@ fserr_warn(char const * prog, char const * op, char const * fname)
             op, fname);
 }
 
-noreturn static void
+lo_noreturn static void
 fserr_exit(char const * prog, char const * op, char const * fname)
 {
     fserr_warn(prog, op, fname);
index 437e81ed9b0a4a2ab23f4ecc32a371128b350478..49c75bb5dbbb285de5dbdece61c3eb7a9197db3b 100644 (file)
@@ -247,16 +247,16 @@ load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
 /*
  * Static declarations from makeshell.c
  */
-noreturn static void
+lo_noreturn static void
 option_exits(int exit_code);
 
-noreturn static void
+lo_noreturn static void
 ao_bug(char const * msg);
 
 static void
 fserr_warn(char const * prog, char const * op, char const * fname);
 
-noreturn static void
+lo_noreturn static void
 fserr_exit(char const * prog, char const * op, char const * fname);
 
 static void
index 8df3591e665977754180686005042afc3221b8f3..9775bdb0b282599b8a048f3183b51785957e2b16 100644 (file)
@@ -514,7 +514,7 @@ optionPrintParagraphs(char const * text, bool plain, FILE * fp)
  *  If "exitCode" is "AO_EXIT_REQ_USAGE" (normally 64), then output will to
  *  to stdout and the actual exit code will be "EXIT_SUCCESS".
 =*/
-noreturn void
+lo_noreturn void
 optionUsage(tOptions * opts, int usage_exit_code)
 {
     int exit_code = (usage_exit_code == AO_EXIT_REQ_USAGE)