bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'vma-prot'


From: Marc Nieper-Wißkirchen
Subject: Re: new module 'vma-prot'
Date: Mon, 2 Sep 2024 14:05:34 +0200

Am Mo., 2. Sept. 2024 um 13:58 Uhr schrieb Bruno Haible <bruno@clisp.org>:
I did:
>       vma-prot: Add tests.
>       * tests/test-vma-prot.c: New file.
>       * modules/vma-prot-tests: New file.

Oops, I forgot some parentheses. (I will never understand why the '&' and '|'
operators, which are most meaningful on unsigned integer values, not on
boolean values, have lower precedence than '=='. Maybe I should ask Dennis
Ritchie's former Bitwise Operations Manager...)

You can find some history in [1], especially in the section "Neonatal C".

Best wishes,

Marc

--


 


2024-09-02  Bruno Haible  <bruno@clisp.org>

        vma-prot tests: Strengthen test.
        Found by Coverity.
        * tests/test-vma-prot.c (main): Fix typo.

diff --git a/tests/test-vma-prot.c b/tests/test-vma-prot.c
index 24b5b1873a..dc100d3af3 100644
--- a/tests/test-vma-prot.c
+++ b/tests/test-vma-prot.c
@@ -65,7 +65,7 @@ main (void)
       {
         prot = get_vma_prot (mem, 1024*1024);
         ASSERT (prot != -1);
-        ASSERT (prot == VMA_PROT_READ | VMA_PROT_WRITE);
+        ASSERT (prot == (VMA_PROT_READ | VMA_PROT_WRITE));

         size_t pagesize = sysconf (_SC_PAGESIZE);
         if (pagesize <= 512*1024





reply via email to

[Prev in Thread] Current Thread [Next in Thread]