https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124836

            Bug ID: 124836
           Summary: GNAT run time libraries on Windows (using a MinGW-w64
                    UCRT64 tool chain) use a max path length of 256
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkacvins at gmail dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

With the releases/gcc-15.1.0 checkout of the gcc repo, (haven't gone back
further in release tags) and even in the master branch of the repo, I see in
gcc/ada/adaint.c this code

#if defined (__MINGW32__)
#include "mingw32.h"
#else
#include <sys/param.h>
#endif

#ifdef MAXPATHLEN
#define GNAT_MAX_PATH_LEN MAXPATHLEN
#else
#define GNAT_MAX_PATH_LEN 256
#endif

This change was made in commit 09b91bbcddd4900d433ea72f08dd11719bceaa58.

My thought on the matter (as I have been burned by the max path length being
256) is that the guard with __MINGW32__ should really be

#if defined (__MINGW32__)
#include "mingw32.h"
#include <sys/param.h>
#endif

Including the mingw-w64-crt header file sys/param.h will define MAXPATHLEN to
PATH_MAX, and PATH_MAX is defined to 260 in limits.h.  Using a MAXPATHLEN of
260 is a good thing, because this matches up with what MSVC defines for
_MAX_PATH/MAX_PATH.

Regards,

Tom

Reply via email to