so, it is good time to adjust .gitignore :)

I also added commit message with explanation. I'm ok if you modify it by
your will.

чт, 10 сент. 2020 г. в 22:34, Willy Tarreau <[email protected]>:

> Hi Ilya,
>
> On Thu, Sep 10, 2020 at 09:45:08PM +0500, ???? ??????? wrote:
> > ping :)
>
> Ah sorry, thanks for the reminedr, I remember reading it and thought it
> was merged, but I was wrong. However I'm seeing two mistakes:
>
>   - first patch accidently merged a copy of your libwurfl.a. Don't
>     worry, I'll edit the patch to get rid of it, that's easy.
>
>   - the second one doesn't explain what the problem was and it's hard to
>     figure it from just the patch itself. Please keep in mind that the
>     purpose of the commit message is in the first place to quickly explain
>     why the patch has to exist in the first place. I can help redact a bit
>     of the message if you're not comfortable with it but I need a bit
>     of input.
>
> Thanks!
> Willy
>
From 8ff6d4b69e4dce1e63364a207484054a9e4c6daf Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Sat, 12 Sep 2020 11:15:43 +0500
Subject: [PATCH 1/3] CLEANUP: Update .gitignore

This excludes ar archives from being ignored.
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 3a760af99..f77751a6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@
 !/reg-tests
 # Reject some generic files
 *.o
+*.a
 *~
 *.rej
 *.orig
-- 
2.26.2

From 4ede61ed91a918e715c636d46320edc3e8e82e90 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Sat, 12 Sep 2020 11:27:51 +0500
Subject: [PATCH 3/3] CI: travis-ci: help Coverity to recognize abort()

generally haproxy uses (*(volatile int*)1=0) for abort. It is not recognized
by static analyzers, e.g. Coverity scan as abort, so fallback to abort() was
introduced in previous commit for code analysis purpose. Let us explicitely
use it for Coverity build job
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index ca867d967..8850850ec 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -55,7 +55,7 @@ matrix:
   - os: linux
     if: type == cron
     compiler: clang
-    env: TARGET=linux-glibc COVERITY_SCAN_PROJECT_NAME="Haproxy" COVERITY_SCAN_BRANCH_PATTERN="*" COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]" COVERITY_SCAN_BUILD_COMMAND="make CC=clang TARGET=$TARGET $FLAGS 51DEGREES_SRC=$FIFTYONEDEGREES_SRC"
+    env: TARGET=linux-glibc COVERITY_SCAN_PROJECT_NAME="Haproxy" COVERITY_SCAN_BRANCH_PATTERN="*" COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]" COVERITY_SCAN_BUILD_COMMAND="make CC=clang DEFINE=-DDEBUG_USE_ABORT TARGET=$TARGET $FLAGS 51DEGREES_SRC=$FIFTYONEDEGREES_SRC"
     script:
       - |
         if [ ! -z ${COVERITY_SCAN_TOKEN+x} ]; then
-- 
2.26.2

From 264c0aa16d1f1a2fcfa0d5777ed6c08921f7552f Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Sat, 12 Sep 2020 11:24:48 +0500
Subject: [PATCH 2/3] BUILD: introduce possibility to define ABORT_NOW()
 conditionally

code analysis tools recognize abort() better, so let us introduce
such possibility
---
 Makefile              |  1 +
 include/haproxy/bug.h | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 48c595511..c0645093c 100644
--- a/Makefile
+++ b/Makefile
@@ -106,6 +106,7 @@
 #   SUBVERS        : add a sub-version (eg: platform, model, ...).
 #   VERDATE        : force haproxy's release date.
 #   VTEST_PROGRAM  : location of the vtest program to run reg-tests.
+#   DEBUG_USE_ABORT: use abort() for program termination, see include/haproxy/bug.h for details
 
 # verbosity: pass V=1 for verbose shell invocation
 V = 0
diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h
index a008126f5..ad2018b13 100644
--- a/include/haproxy/bug.h
+++ b/include/haproxy/bug.h
@@ -37,10 +37,15 @@
 #define DPRINTF(x...)
 #endif
 
-/* This abort is more efficient than abort() because it does not mangle the
- * stack and stops at the exact location we need.
- */
+#ifdef DEBUG_USE_ABORT
+/* abort() is better recognized by code analysis tools */
+#define ABORT_NOW() abort()
+#else
+/* More efficient than abort() because it does not mangle the
+  * stack and stops at the exact location we need.
+  */
 #define ABORT_NOW() (*(volatile int*)1=0)
+#endif
 
 /* BUG_ON: complains if <cond> is true when DEBUG_STRICT or DEBUG_STRICT_NOCRASH
  * are set, does nothing otherwise. With DEBUG_STRICT in addition it immediately
-- 
2.26.2

Reply via email to