bugGNU roff - Bugs: bug #55018, src/utils/indxbib/signal.c: define...

 
 

bug #55018: src/utils/indxbib/signal.c: define _POSIX_C_SOURCE

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Tue 13 Nov 2018 07:51:14 PM UTC
   
 
Category:  Core Severity:  1 - Wish
Item Group:  Build/Installation Status:  Invalid
Privacy:  Public Assigned to:  schwarze
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 23 Jan 2020 08:25:21 PM UTC, comment #4: 

Closing the ticket because the OP not only fails to provide any useful information whatsoever but even actively refuses to provide them when asked for specific details, and the patches he provides make it obvious that he doesn't have the slightest idea what he is doing, even after some issues have been explained to him.

Ingo Schwarze <schwarze>
Group Member
Thu 23 Jan 2020 07:37:21 PM UTC, comment #3: 


>So it appears Bjarni has misconfigured his compiler in some way he doesn't specify and maybe isn't even aware of.


>Unless somebody can provide a proper explanation, i suggest closing this ticket as invalid.


  I see no evidence for an invalid report.

  My compiler is not misconfigured as it reports issues and is therefore
subject to less (if any) censorship.

  Maybe a conditional inclusion is the best one


/* Define this; see kill(2) (man-pages, manpages) and
   feature_test_macros(7) (ftm(7)). */
#ifndef _POSIX_C_SOURCE
#  define _POSIX_C_SOURCE 1
#endif


Bjarni Ingi Gislason <bjarniig>
Mon 20 Jan 2020 05:03:33 PM UTC, comment #2: 

To me, this ticket looks rather bogus.

I have no idea what Bjarni is even doing, he doesn't show the compiler command line he is running, nor does he show his config.h.

Using the standard C kill(2) function certainly does not require defining arcane feature-test macros.  Just including <signal.h> is enough according to the POSIX standard, see https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html - and the file already includes that header.

So far, i failed to reproduce the problem, using clang version 8.0.1 on OpenBSD-current/amd64.

Unfortunately, the groff build system hides compiler command lines from the logs, so i cannot easily vary compiler options to try harder to reproduce.  It only prints "CC src/utils/indxbib/signal.o" which is obviously not what it actually does.  I strongly feel that obfuscation ought to be removed.  Such obfuscation really makes debugging harder for no benefit whatsoever.

Either way, even if there is a problem at all, which i seriously doubt, defining _POSIX_C_SOURCE to 1 sounds like an extremely bad idea.  That is requesting a long obsolete standard, and i'm not aware that the devellopers currently working on groff are expected to code according to that obsolete standard.

If there is a problem, then the root cause needs to be explained and fixed, not some cargo cult thrown in without even considering whether that may cause other problems down the line.

By the way, on a Debian jessie box i have access to, the default value of _POSIX_C_SOURCE when the application defines nothing appears to be 200809L, which looks quite sane to me.

So it appears Bjarni has misconfigured his compiler in some way he doesn't specify and maybe isn't even aware of.

Unless somebody can provide a proper explanation, i suggest closing this ticket as invalid.

Ingo Schwarze <schwarze>
Group Member
Mon 20 Jan 2020 01:15:13 PM UTC, comment #1: 

It is time to commit a fix for this.

Bjarni Ingi Gislason <bjarniig>
Tue 13 Nov 2018 07:51:14 PM UTC, original submission:  


From e70ab643c4690f044e2e56126b2b66f9127ee2bc Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Tue, 13 Nov 2018 19:37:49 +0000
Subject: [PATCH] src/utils/indxbib/signal.c: define _POSIX_C_SOURCE

  The gcc-compiler can issue a warning:

../src/utils/indxbib/signal.c: In function 'handle_fatal_signal':
../src/utils/indxbib/signal.c:51:3: warning: implicit declaration of function 'kill' [-Wimplicit-function-declaration]
   kill(getpid(), signum);
   ^~~~

  The man page "kill(2)" mentions:

   Feature Test Macro Requirements for glibc (see
feature_test_macros(7)):

       kill(): _POSIX_C_SOURCE

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 src/utils/indxbib/signal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/utils/indxbib/signal.c b/src/utils/indxbib/signal.c
index fd498719..c677c8fe 100644
--- a/src/utils/indxbib/signal.c
+++ b/src/utils/indxbib/signal.c
@@ -19,6 +19,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 /* Unfortunately vendors seem to have problems writing a <signal.h>
 that is correct for C++, so we implement all signal handling in C. */

+/* Define this; see kill(2) and feature_test_macros(7). */
+#define _POSIX_C_SOURCE 1
+
 #include <stdlib.h>

 #ifdef HAVE_CONFIG_H
--
2.19.1


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by schwarze (Posted a comment)
  • -email is unavailable- added by bgarrigues (Updated the item)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-10 gbranden Assigned tobgarrigues schwarze
        Summary[PATCH] src/utils/indxbib/signal.c: define _POSIX_C_SOURCE src/utils/indxbib/signal.c: define _POSIX_C_SOURCE
    2022-01-11 gbranden Item GroupWarning/Suspicious behaviour Build/Installation
    2020-01-23 schwarze Severity2 - Minor 1 - Wish
        StatusConfirmed Invalid
        Open/ClosedOpen Closed
    2018-11-26 bgarrigues Severity3 - Normal 2 - Minor
        Item GroupBuild/Installation Warning/Suspicious behaviour
        StatusNone Confirmed
        Assigned toNone bgarrigues

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code