r373213 - Correct function declarations; NFC.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 07:43:52 PDT 2019


Author: aaronballman
Date: Mon Sep 30 07:43:52 2019
New Revision: 373213

URL: http://llvm.org/viewvc/llvm-project?rev=373213&view=rev
Log:
Correct function declarations; NFC.

This header is included by C code so the functions need to have a prototype. Also, fix the function definitions so that they have C linkage rather than C++ linkage.

Modified:
    cfe/trunk/include/clang-c/FatalErrorHandler.h
    cfe/trunk/tools/libclang/FatalErrorHandler.cpp

Modified: cfe/trunk/include/clang-c/FatalErrorHandler.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/FatalErrorHandler.h?rev=373213&r1=373212&r2=373213&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/FatalErrorHandler.h (original)
+++ cfe/trunk/include/clang-c/FatalErrorHandler.h Mon Sep 30 07:43:52 2019
@@ -18,14 +18,14 @@ extern "C" {
  * Installs error handler that prints error message to stderr and calls abort().
  * Replaces currently installed error handler (if any).
  */
-void clang_install_aborting_llvm_fatal_error_handler();
+void clang_install_aborting_llvm_fatal_error_handler(void);
 
 /**
  * Removes currently installed error handler (if any).
  * If no error handler is intalled, the default strategy is to print error
  * message to stderr and call exit(1).
  */
-void clang_uninstall_llvm_fatal_error_handler();
+void clang_uninstall_llvm_fatal_error_handler(void);
 
 #ifdef __cplusplus
 }

Modified: cfe/trunk/tools/libclang/FatalErrorHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/FatalErrorHandler.cpp?rev=373213&r1=373212&r2=373213&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/FatalErrorHandler.cpp (original)
+++ cfe/trunk/tools/libclang/FatalErrorHandler.cpp Mon Sep 30 07:43:52 2019
@@ -18,11 +18,13 @@ static void aborting_fatal_error_handler
   ::abort();
 }
 
-void clang_install_aborting_llvm_fatal_error_handler() {
+extern "C" {
+void clang_install_aborting_llvm_fatal_error_handler(void) {
   llvm::remove_fatal_error_handler();
   llvm::install_fatal_error_handler(aborting_fatal_error_handler, nullptr);
 }
 
-void clang_uninstall_llvm_fatal_error_handler() {
+void clang_uninstall_llvm_fatal_error_handler(void) {
   llvm::remove_fatal_error_handler();
 }
+}
\ No newline at end of file




More information about the cfe-commits mailing list