Commit Graph

40 Commits

Author SHA1 Message Date
Paul Smith
3d4f3e0627 * doc/make.texi: Document temporary file name prefix
* src/posixos.c (jobserver_setup): Set prefix for FIFO temp file.
Ensure it can't conflict with a "normal" temp file.
* src/w32/w32os.c (os_anontmp): Set prefix for anon temp files.
2024-03-24 16:23:28 -04:00
Paul Smith
242603fa46 [SV 65268] Un-set append mode for stdout/stderr on exit
It turns out that options set on stdout/stderr last after exit.
Leaving append-mode enabled can break other facilities, so reset the
flags on stdout/stderr before we exit.

* src/os.h: Add a new fd_reset_append() to reset flags on FDs.
Modify fd_set_append() to return the old flags.
* src/posixos.c (fd_reset_append): Set provided flags on the FD.
(fd_set_append): Return the previous flags set on the FD.
* src/output.c (output_init): Preserve old flags for stdout/stderr.
(output_close): Reset flags for stdout/stderr.
* src/w32/w32os.c: Implement dummy methods.
2024-03-24 15:25:53 -04:00
Paul Smith
a80670ad41 * (all): Update Copyright year to 2024 2024-01-06 18:06:09 -05:00
Torbjörn SVENSSON
1000374759 Fix GCC compile warning for "bad-function-cast" on Windows
Trick the compiler by hiding the cast in a function call.

* src/os.h: Declare the new function.
* src/w32/w32os.c (get_handle_for_fd): Convert and cast a file
descriptor into a Windows HANDLE.
(check_io_state): Call the new function rather than casting.
(osync_release): Ditto.
(fd_inherit): Ditto.
(fd_noinherit): Ditto.
* src/function.c (windows32_openpipe): Ditto.
* src/w32/compat/posixfcn.c (isatty): Ditto.
* src/w32/subproc/sub_proc.c (process_easy): Ditto.
2023-07-04 14:26:58 -04:00
Torbjörn SVENSSON
8d76fb8778 Fix GCC compile warning for "format-signedness" in Windows
* src/job.c (reap_children): Use unsigned int for DWORD.
* src/w32/subproc/sub_proc.c (process_easy): Ditto.
* src/w32/w32os.c (jobserver_setup): Ditto.
(jobserver_release): Ditto.
(jobserver_acquire): Ditto.
2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
ee366afbf1 * src/w32/compat/posixfcn.c (ttyname): Avoid const char* 2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
b686980c66 Fix GCC compile warning for "unused-parameter" on Windows
* src/w32/compat/posixfcn.c (isatty): Avoid unused-parameter warnings.
(jobserver_pre_child): Ditto.
(jobserver_post_child): Ditto.
(jobserver_acquire): Ditto.
(fd_set_append): Ditto.
2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
8e5c96c318 Fix GCC compile warning format-security on Windows
* src/job.c (create_batch_file): Avoid non-static format strings.
* src/main.c (handle_runtime_exceptions): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Ditto.
2023-07-01 12:49:24 -04:00
Torbjörn SVENSSON
363bdaef8c Fix GCC compile warning declaration-after-statement on Windows
* src/w32/w32os.c (check_io_state): Move the HANDLE declarations.
2023-07-01 12:49:20 -04:00
Costas Argyris
b2bf660abc Add a UTF-8 resource when building for Windows
If a resource compiler is available, use it to add a UTF-8 resource
to the GNU Make executable on Windows.  As a result, GNU Make will
use UTF-8 as its ANSI code page, enabling it to work with UTF-8
encoded Makefiles, understand UTF-8 paths passed to it, etc.

These build process changes apply to all 3 ways that GNU Make can
be built for Windows:

1) configure
2) Basic.mk
3) build_w32.bat

When building with Visual Studio the resource compiler should always
be available.

When building with GCC or TCC, it depends on the availability of
'windres'.

If a resource compiler is not available, don't fail the build but
just proceed without the UTF-8 resource, effectively ignoring this
feature.

The UTF-8 resource only has an effect when GNU Make is running on a
minimum target version of Windows Version 1903 (May 2019 Update).
When the built GNU Make is running on an earlier version of Windows,
the embedded UTF-8 resource has no effect.

Code page information is added to --version output to tell users what
code pages are being used by any combination of GNU Make build (with
or without the UTF-8 resource) and Windows version that GNU Make is
running on (earlier than 1903 or not).

* README.git: Fix a typo.
* configure.ac: Search for windres and set WINDRES / HAVE_WINDRES.
* Makefile.am: Add manifest and resource files to EXTRA_DIST and
add a windres invocation to build them.
* build_w32.bat: Add support to build resource files.
* src/main.c (print_version): Add codepage info to Windows output.
* src/w32/utf8.manifest: Add a windres manifest file.
* src/w32/utf8.rc: Add a windres resource file.
* Basic.mk.template: Add support for building resource files.
* mk/Windows32.mk: Support windres resource files.
* .gitignore: Ignore TCC output directories.
2023-06-19 13:29:52 -04:00
Paul Smith
78c8c44326 Add functions to directly expand variables by name
Replace all locally-created "$("+varname+")" and similar constructs
with calls to these new functions.

* src/expand.c (expand_variable_output): Call expand_string_output()
on the expansion of a variable value.  Replaces reference_variable().
(expand_variable_buf): Like expand_variable_output() but return the
starting location of the result.
(allocated_expand_variable): Like expand_variable_buf() but return
an allocated string.
(expand_string_buf): Call expand_variable_output().
* src/variable.h: Declare the new functions.
* src/function.c (func_call): Call expand_variable_output() instead
of expand_string_buf().
* src/main.c (decode_env_switches): Call expand_variable() instead
of expand_string().
* src/remake.c (library_search): Call allocated_expand_variable()
instead of expand_string() plus xstrdup().
* src/vpath.c (build_vpath_lists): Expand VPATH and GPATH using
expand_variable() instead of expand_string().
* src/w32/subproc/sub_proc.c (process_begin): Use expand_variable()
to expand SHELL.  Also use alloc() in case the result is larger than
PATH_MAX.
2023-04-01 11:13:12 -04:00
Paul Smith
caf1d4c28f Clean up expand.c
Clarify the naming and documentation on functions in src/expand.c:
- variable_expand -> expand_string
- variable_expand_string -> expand_string_buf
- variable_expand_for_file -> expand_string_for_file
- allocated_variable_expand -> allocated_expand_string
- allocated_variable_expand_for_file ->
  allocated_expand_string_for_file
Change all callers to use the new names.

* src/variable.h: Rename the functions and macros.
* src/expand.c: Ditto.
* src/file.c: Use the new function names.
* src/function.c: Ditto.
* src/implicit.c: Ditto.
* src/job.c: Ditto.
* src/loadapi.c: Ditto.
* src/main.c: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.
* src/variable.c: Ditto.
* src/vpath.c: Ditto.
* src/w32/subproc/sub_proc.c: Ditto.
2023-03-26 16:48:48 -04:00
Paul Smith
8285852e55 Clean up some preprocessor operations 2023-01-16 13:01:09 -05:00
Paul Smith
6128c3e266 Rename WINDOWS32 macro to MK_OS_W32
* configure.ac: Set MK_OS_W32 to 1 if we're on Windows32.
* src/config.h.W32: Ditto.
* mk/Windows32.mk: Ditto.
* src/makeint.h: Convert #if refs to WINDOWS32, to use MK_OS_W32.
* src/*: Ditto.
* src/w32/*: Ditto.
* gl/lib/*: Ditto.
2023-01-15 18:27:13 -05:00
Paul Smith
56d2978141 Update the copyright year on all files 2023-01-01 10:06:01 -05:00
Paul Smith
c91b269f66 Apply spelling fixes discovered by Codespell
* maintMakefile: Apply spelling fixes.
* src/file.c: Ditto.
* src/misc.c: Ditto.
* src/remake.c: Ditto.
* src/vmsjobs.c: Ditto.
* src/w32/pathstuff.c: Ditto.
* tests/test_driver.pl: Ditto.
* tests/run_make_tests.com: Ditto
* tests/scripts/features/implicit_search: Ditto
* tests/scripts/features/output-sync: Ditto
* tests/scripts/features/patternrules: Ditto
* tests/scripts/features/se_explicit: Ditto
* tests/scripts/features/statipattrules: Ditto
* tests/scripts/functions/foreach: Ditto
* tests/scripts/variables/MAKEFLAGS: Ditto
2022-12-31 13:21:09 -05:00
Paul Smith
89427039c3 [WINDOWS32] Remove CRNL from FormatMessage() result string
Sometimes the error message is expected to contain a newline, other
times it is not.  Also the result of FormatMessage() sometimes ends
in CRNL already: when printed via fprintf() the final newline is
converted to CRNL, giving an output of CRCRNL which causes tests
to fail to match.  Remove any CR/NL chars from the result string.

* src/job.c (reap_children): Add \n to the error message fprintf.
(exec_command): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Remove
any trailing CR or NL from the string before returning.
2022-12-19 00:20:06 -05:00
Paul Smith
4c9d87f4ae Keep going if we can't connect to the jobserver
* src/posixos.c (jobserver_parse_auth): Don't invoke fatal() if we
can't connect to an existing jobserver: just keep going without it.
* src/w32/w32os.c (jobserver_parse_auth): Ditto.
* tests/scripts/features/jobserver: Add a test for invalid FIFO
auth files.
2022-11-13 10:39:48 -05:00
Paul Smith
f364e0d8d6 Set PATH_MAX on systems without a default value
Some systems (HURD) use fully-dynamic pathnames, with no limit.
We can't support this without significant effort so for now set
PATH_MAX to a large value.

* src/makeint.h: Set PATH_MAX to 4096 if not set and MAXPATHLEN
is also not set.  Remove MAXPATHLEN setting: we won't use it.
* src/misc.c (get_path_max): If we can't get the path max via
pathconf() use the default PATH_MAX.
* src/dir.c (find_directory) [W32]: Use MAX_PATH not MAXPATHLEN.
(local_stat) [W32]: Ditto.
* src/job.c (create_batch_file) [W32]: Ditto.
* src/remake.c (name_mtime) [W32]: Ditto.
* src/w32/w32os.c (os_anontmp) [W32]: Ditto.
2022-10-22 22:40:26 -04:00
Paul Smith
d9fc1ac5d2 Update URLs to use https rather than http
* (all): Change http:// to https://
* README.W32: Remove invalid link to mingw.org.
2022-10-18 14:37:47 -04:00
Paul Smith
3e20e376b7 Clean up some warnings on Windows builds
* src/arscan.c (parse_int): Avoid conversion from int to char and
check for overflow given a max value.
(ar_scan): Check intmax sizes then cast to the proper type.
(ar_member_touch): Get proper return type from ar_scan and cast it
to off_t.
* src/function.c (a_word_hash_cmp): Don't cast from size_t to int.
(func_filter_filterout): Count using unsigned long to avoid casts.
(construct_include_path): Explicitly cast to void*.
* src/shuffle.c (reverse_shuffle_array): Use size_t index.
* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
Initialize the return value in case the count is 0.
2022-10-03 16:08:14 -04:00
Eli Zaretskii
387d349dc8 Fix compiler warnings in the MS-Windows build.
* src/w32/w32os.c (osync_get_mutex, osync_parse_mutex): Cast to
DWORD_PTR when converting integers to HANDLEs and vice versa.

* src/w32/pathstuff.c (w32ify): Pacify compiler warnings about
'strncpy'.

* src/makeint.h (PRId64) [!HAVE_INTTYPES_H]: Define if undefined.
* src/function.c (func_wordlist): Use PRId64 instead of %lld.
2022-09-25 17:11:12 +03:00
Paul Smith
4da2055a10 Rework output sync to lock a temp file on POSIX
Some POSIX systems do not allow locks to be taken on non-files, such
as pipes.  This is a problem since very often make is invoked with
its stdout redirected to a pipe.  Also, if stdout is redirected to a
file that already has a lock on it for some other reason (perhaps a
shared file such as /dev/null) it can cause a hang.

This means our previous method of locking stdout, although it had some
nice advantages, is not portable enough.  Instead, use a temporary
file and take the lock on that.  We pass the name of the file to child
make processes.  On Windows we continue to use a shared mutex for
output sync.

Remove POSIX emulation functions like fcntl from Windows; instead
follow the lead of the jobserver and create an interface in os.h for
output sync, and move the OS-specific content to posixos.c and
w32os.c.

* NEWS: Add a note.
* src/makeint.h (ALL_SET): Check that all bits are set.
* src/os.h: Add bits for checking the state of stdin/stdout/stderr.
Add prototypes for OS-specific output sync methods.
* src/posixos.c (check_io_state): Determine the status of stdin,
stdout, stderr an return a suite of bits describing them.
(osync_enabled): If the global variable holding the FD of the lock
file (osync_handle) is valid return true.
(osync_setup): Create a temporary file and remember its name in a
global variable (osync_tmpfile), and set osync_handle.
(osync_get_mutex): If output sync is enabled, return the filename
of the lock file prefixed with "fnm:" to denote a filename.
(osync_parse_mutex): If the provided filename has the wrong format
disable output sync.  Else open the lock file and set osync_handle.
(osync_clear): Close osync_handle.  If we're the parent make, then
also unlink the temporary file.
(osync_acquire): Take a lock on the osync_handle descriptor.
(osync_release): Release the lock on the osync_handle descriptor.
(fd_set_append): Add APPEND mode to a file descriptor.
* src/w32/w32os.c: Perform the same actions as posixos.c, copying
the details from src/w32/compat/posixfcn.c.  Use a mutex rather
than locking a temporary file.
* src/output.h: Remove all the OS-specific content.
* src/output.c: Remove all the OS-specific content.
(set_append_mode): Remove and replace with fd_set_append().
(sync_init): Remove and replace with check_io_state().
(acquire_semaphore): Remove and replace with osync_acquire().
(release_semaphore): Remove and replace with osync_release().
(setup_tmpfile): If the IO state is not obtained, get it.  If stdout
and/or stderr are valid, set up a tempfile to capture them.
(output_init): Set io_state if not set already, and check it when
deciding whether to close stdout on exit.
* src/main.c (main): If we're syncing, set up the mutex using the
new osync_setup() / osync_parse_mutex() methods.
(prepare_mutex_handl_string): Replace with osync_parse_mutex().
(die): Call osync_clear().
* src/w32/compat/posixfcn.c: Remove implementations of fcntl(),
record_sync_mutex(), create_mutex(), and same_stream().
2022-08-30 15:44:43 -04:00
Paul Smith
a2ba5ccbda Add get_tmpfd() and allow anonymous temp files
The output sync feature wants a file descriptor not a FILE*.  We were
using tmpfile() but this returns FILE* which means we needed to dup()
the descriptor then fclose() the original, which is just unnecessary
overhead for every command we run.

Create a get_tmpfd() method that returns a file descriptor directly
by using mkstemp() if available, else do the best we can.

Also allow anonymous temp files if the filename pointer is NULL.
This causes the file to be unlinked.  On Windows this requires a
special open so add an os_anontmp() method to handle this.

* src/makeint.h: Add prototype for get_tmpfd().
* src/misc.c (get_tmpfd): If we have mkstemp() use that, else just
open(2).  If we don't want to keep the filename, unlink the file.
(get_tmpfile): Use get_tmpfd() if we have fdopen(), else use fopen().
* src/output.c (output_tmpfd): Call get_tmpfd() with NULL.
* src/os.h (os_anontmp): On Windows make this a function, else fails.
* src/w32/compat/posixcfn.c (tmpfile): Move to w32os.c:os_anontmp().
* src/w32/w32os.c (os_anontmp): Create a temp file that will be deleted
when the process exits, and return a file descriptor to it.
2022-08-30 15:39:02 -04:00
Paul Smith
7ad2593b2d Support implementing the jobserver using named pipes
Using anonymous pipes for jobserver support has some advantages:
for example there is nothing on disk that needs to be cleaned up.
However it has many obscure problems, related to the fact that in
order for it to work we need to ensure these resources are properly
passed through to child processes that want to use the jobserver.
At the same time we don't want to pass the pipe to process which
DON'T know about the jobserver.

Other processes can open file descriptors which we then think are
our jobserver, but aren't.  And, we open the pipe file descriptors
in blocking mode which doesn't work for all users.

See issues such as SV 57178, SV 57242, and SV 62397

To avoid these issues, use named pipes (on systems where they are
available) instead of anonoymous pipes.  This simplifies many things:
we never need to pass open file descriptors to our children; they
can open the jobserver named pipe.  We don't need to worry about
recursive vs. non-recursive children.  Users don't have to "pass
through" the resources if they are invoking sub-makes.  Each child
can open its own file descriptor and set blocking as needed.

The downside is the named pipe exists on disk and so must be cleaned
up when the "top-level" make instance exits.

In order to allow make to continue to be used in build systems where
older versions of GNU make, or other tools that want to use the
jobserver, but don't understand named pipes, introduce a new option
--jobserver-style that allows the user to choose anonymous pipes.

* NEWS: Announce the change and the --jobserver-style option.
* doc/make.1: Add --jobserver-style documentation.
* doc/make.texi (Special Variables): Add missing items to .FEATURES.
(Options Summary): Add --jobserver-style.
(POSIX Jobserver): Named pipes, changes to --jobserver-auth, and the
--jobserver-style option.
(Windows Jobserver): Document --jobserver-style for Windows.
* configure.ac: Check for mkfifo.
* src/config.h-vms.template: Undefined HAVE_MKFIFO.
* src/config.h.W32.template: Ditto.
* src/main.c: Add jobserver-style as a new command line option.
(main): Add jobserver-fifo to .FEATURES if supported.  Pass the style
option to jobserver_setup().
* src/os.h (jobserver_setup): Accept a style string option.
* src/posixos.c (enum js_type): Enumeration of the jobserver style.
(js_type): Which style we are currently using.
(fifo_name): The path to the named pipe (if in use).
(jobserver_setup): If no style is given, or "fifo" is given, set up a
named pipe: get a temporary file and use mkfifo() on it, then open it
for reading and writing.  If something fails fall back to anonymous
pipes.
(jobserver_parse_auth): Parse jobserver-auth to determine the style.
If we are using a named pipe, open it.  If we're using anonymous pipes
ensure they're valid as before.
(jobserver_get_invalid_auth): Don't invalidate the jobserver when
using named pipes.
(jobserver_clear): Clean up memory used for named pipes.
(jobserver_acquire_all): Unlink the named pipe when done.
* src/w32/w32os.c (jobserver_setup): Check the style argument.
* tests/scripts/features/jobserver: Use --jobserver-style to test
the anonymous pipe behavior, and also test named pipe/semaphore
behavior.  Check invalid jobserver-style options.
* tests/scripts/functions/shell: Use --jobserver-style to test the
anonymous pipe behavior, and also test named pipe/semaphore
behavior.
2022-08-02 23:36:35 -04:00
Paul Smith
16e14b4114 Disable the jobserver in non-recursive children
Savannah issues such as SV 57242 and SV 62397 show how passing
references to closed file descriptors via the --jobserver-auth option
in MAKEFLAGS can lead to problematic outcomes.

When computing the child environment for a non-recursive shell, add
an extra option to MAKEFLAGS to disable the file descriptors for the
jobserver.

Unfortunately this doesn't modify the value of the make variable
MAKEFLAGS, it only modifies the value of the sub-shell environment
variable MAKEFLAGS.  This can lead to confusion if the user is not
considering the distinction.

* src/makeint.h: Publish the jobserver-auth value.  Add a global
definition of the name of the command line option.
* src/os.h (jobserver_get_invalid_auth): New function to return a
string invalidating the jobserver-auth option.
* src/w32/w32os.c (jobserver_get_invaid_auth): Implement it.  On
Windows we use a semaphore so there's no need to invalidate.
* src/posixos.c (jobserver_parse_auth): If we parse the invalid
auth string, don't set up the jobserver.
(jobserver_get_invalid_auth): Return an invalid option.
* src/variable.h (target_environment): Specify if the target
environment is for a recursive shell or non-recursive shell.
* src/variable.c (target_environment): Move checking for MAKELEVEL
into the loop rather than doing it at the end.
Along with this, check for MAKEFLAGS and MFLAGS, and update them
based on whether we're invoking a recursive or non-recursive child,
and also on whether it's necessary to invalidate the jobserver.
* src/function.c (func_shell_base): Shell functions can never be
recursive to pass 0 to target_environment().
* src/job.c (start_job_command): Specify whether the child is
recursive when calling target_environment().
* src/main.c: Export jobserver_auth.  sync_mutex doesn't need to
be exported.  Use the global definition for the option name.
* tests/scripts/variables/MAKEFLAGS: Add tests for $MAKEFLAGS.
2022-07-30 18:40:28 -04:00
Paul Smith
97e51c0285 Avoid overwriting buffers with long pathnames
Reported, with initial patch, by Gisle Vanem <gvanem@online.no>

* src/main.c (find_and_set_default_shell) [W32]: Pass search_token
directly to w32ify: no need to make a copy first.  When we need to
construct a path, use snprintf() to be sure we don't overwrite
the locally-allocated buffer.
* src/w32/pathstuff.c (w32ify) [W32]: Use the malloc version of
_fullpath(), followed by strncpy(), to avoid overwriting buffers.
2022-06-17 19:55:11 -04:00
Paul Smith
ec09ec775a * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
Paul Smith
c5d4b7b2f2 Clean up more Windows warnings.
* src/config.h.W32.template: Re-enable warnings that we don't violate.
Add a new disabled warning: 4130 (logical operation on address of
string constant).
* src/w32/compat/posixfcn.c: Make makeint.h the first included header.
* src/w32/subproc/sub_proc.c: Ditto.  It includes config.h already.
2021-09-07 01:14:33 -04:00
Jens Rehsack
289108cc9b * src/output.h: [WINDOWS32] [SV 57888] Use gnulib fcntl if available
If gnulib fcntl is available (for MinGW32) use it rather than our
homegrown version.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Copyright-paperwork-exempt: yes
2020-03-31 01:07:43 -04:00
Jens Rehsack
61c413d5ea * src/w32/compat/dirent.c: [SV 57888] Use gnulib opendir on MinGW32
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Copyright-paperwork-exempt: yes
2020-03-31 00:50:21 -04:00
Paul Smith
4533348826 Apply spelling corrections from Fossies spellcheck
See https://fossies.org/features.html#codespell
Spelling issues in Git commit messages or lib/* source are not applied.

* README.OS2.template: Apply spelling corrections.
* README.VMS: Ditto.
* src/commands.c: Ditto.
* src/config.ami.template: Ditto.
* src/configh.dos.template: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/read.c: Ditto.
* src/variable.c: Ditto.
* src/vms_exit.c: Ditto.
* src/vms_export_symbol.c: Ditto.
* src/vms_progname.c: Ditto.
* src/vmsfunctions.c: Ditto.
* src/vmsjobs.c: Ditto.
* src/w32/pathstuff.c: Ditto.
* tests/scripts/variables/automatic: Ditto.
* tests/test_driver.pl: Ditto.
2020-01-20 19:25:54 -05:00
Paul Smith
12b14f0484 Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
Paul Smith
34ee9adaed * src/config.h.W32.template [W32]: Add support for dirent.d_type
* src/w32/include/dirent.h: Add DT_* values for dirent.d_type
(struct dirent): Add d_type
* src/w32/compat/durent.c (readdir): Set dirent.d_type based on
Windows file attributes.
2019-09-07 20:12:44 -04:00
Eli Zaretskii
715c787dc6 Fix MS-Windows MinGW build
* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
Fix format specifier for GetLastError's value.

* src/job.c (reap_children): Define the 'remote_status_lose' label
only for Posix platforms, to avoid compiler warning.

* build_w32.bat (LNKOUT): New variable, using forward slashes.
Use forward slashes in calls to :Compile, so that linking with GNU
ld works.

* src/makeint.h [!HAVE_UMASK]: Prototype for 'umask'.
(UMASK, MODE_T): Don't define.

* src/misc.c (get_tmpfile): Don't call UMASK, call umask, to
avoid compilation warning on !HAVE_UMASK platforms.
* src/output.c (output_tmpfd): Likewise.

* src/misc.c (umask) [!HAVE_UMASK]: New no-op function.

* src/config.h.W32.template (__USE_MINGW_ANSI_STDIO)
[__MINGW32__]: Define to 1, to force Make use ANSI-compatible
stdio functions, which also support the non-standard 'Id' and 'Ix'
specifiers.
(HAVE_UMASK) [__MINGW32__]: Define to 1.

* src/arscan.c (ar_member_touch): Type-cast argument of strlen to
avoid compiler warnings.
2019-08-28 17:45:49 +03:00
Paul Smith
389dcb608f Update copyright statements for 2019 2019-05-19 15:27:26 -04:00
Paul Smith
b36a8ec92a * src/read.c(unescape_char): Use C comments not C++ comments.
* src/posixos.c(set_blocking): Ditto.
* src/w32/subproc/sub_proc.c(process_init): Ditto
2018-08-02 20:59:02 -04:00
Paul Smith
0ce880e5ee Resolve most of the Windows Visual Studio warnings.
* Convert integer types to size_t where necessary.
* Align other integral types to avoid casts and type warnings.
2018-07-02 07:54:07 -04:00
Paul Smith
afbecbd9dc * all: Update Copyright statements for 2018 2018-07-01 12:22:04 -04:00
Paul Smith
fb779d2f1e Rework directory structure to use GNU-recommended "src" directory.
Move the source code (other than glob) into the "src" subdirectory.
Update all scripting and recommendations to support this change.

* *.c, *.h, w32/*: Move to src/
* configure.ac, Makefile.am, maintMakefile: Locate new source files.
* Basic.mk.template, mk/*: Update for new source file locations.
* NEWS, README.DOS.template: Update for new locations.
* build.template, build_w32.bat, builddos.bat: Ditto.
* po/POTFILES.in: Ditto
* tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
* make.1: Move to doc.
* mk/VMS.mk: Add support for building on VMS (hopefully).
* makefile.vms, prepare_w32.bat: Remove.
* SCOPTIONS: Update to define HAVE_CONFIG_H
2017-11-19 14:07:22 -05:00