bugGNU nano - Bugs: bug #65684, conditionalize inclusion of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #65684: conditionalize inclusion of 'sys/wait.h' on HAVE_SYS_WAIT_H

Submitter:  Fabio <oldfaber>
Submitted:  Sat 04 May 2024 05:36:35 PM UTC
   
 
Severity:  3 - Normal Status:  Need Info
Assigned to:  None Open/Closed:  Open

Mon 06 May 2024 02:09:08 PM UTC, comment #4: 

There is the same fatal error in src/files.c, where "#include <pwd.h>" must also be conditioned by HAVE_PWD_H macro.

To be able to generate nano.exe with mingw gcc in windows and use it in a windows terminal needs many more
modifications: getline(), regex(), realpath(), wcwidth(), ...

#ifdefing out an #include tested by configure looked the easy first step to find if a trivial patch
could be accepted, looks like not.

Thank you for your efforts.

Signed-off-by: Fabio Fabbri oldfaber at gmail dot com

Fabio

Fabio <oldfaber>
Sun 05 May 2024 02:47:20 PM UTC, comment #3: 

If sys/wait.h is not available on Mingw, then why is there no fatal error for src/files.c (which also includes sys/wait.h)?

The configure step does not #ifdef out anything -- ./configure does not modify the src/*.c files.

There is no talk of copyright assignment or anything like that.  It's just a Signed-of-by line that is required, plus a proper commit.  If you can't be bothered...

Benno Schulenberg <bens>
Group administrator
Sun 05 May 2024 02:21:41 PM UTC, comment #2: 

sys/wait.h is not evailable with mingw64 gcc on Windows, and the the error obviously is

text.c:34:22: fatal error: sys/wait.h: No such file or directory
compilation terminated.
make: * [<builtin>: nano] Error 1

the configure step is supposed to find not available #include files and #ifdef them out.
The code where waitpid() is used is already not compiled (in Windows) because HAVE_FORK
and HAVE_WAITPID are not defined.

The two line #if patch is so trivial that no copyright assigment is needed, but it's your call.

P.S. I have some more trivial patches like this one, if it's rejected I will stop here.

Regards,

Fabio

Fabio <oldfaber>
Sun 05 May 2024 08:22:11 AM UTC, comment #1: 

Ehm...  What is the error message without this patch?  And: why does the '#include <sys/wait.h>' in src/files.c not need to be conditionalized?

Anyway, please provide a signed-off patch (as is mentioned in README.hacking) with a rationale in the commit message.

Benno Schulenberg <bens>
Group administrator
Sat 04 May 2024 05:36:35 PM UTC, original submission:  

Hi,

please add the test of HAVE_SYS_WAIT_H to text.c,
see attached patch. Discovered generating a native mingw64
version of nano.
 
Thanks.
Fabio

Fabio <oldfaber>

 

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

Attached Files
file #56008:  patch-text added by oldfaber (315B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by oldfaber (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.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-05 bens Summaryconditionalize inlcusion of 'sys/wait.h' on HAVE_SYS_WAIT_H conditionalize inclusion of 'sys/wait.h' on HAVE_SYS_WAIT_H
    2024-05-05 bens StatusNone Need Info
        SummaryUse HAVE_SYS_WAIT_H macro conditionalize inlcusion of 'sys/wait.h' on HAVE_SYS_WAIT_H
    2024-05-04 oldfaber Attached File- Added patch-text, #56008

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code