Bug 23187 - MAXPATHLEN usage in gcc/ada/*.c
Summary: MAXPATHLEN usage in gcc/ada/*.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.0.0
: P5 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: 21824
  Show dependency treegraph
 
Reported: 2005-08-01 21:30 UTC by Thomas Schwinge
Modified: 2009-03-08 09:11 UTC (History)
4 users (show)

See Also:
Host: i386-pc-gnu
Target: i386-pc-gnu
Build: i386-pc-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-08-02 01:15:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schwinge 2005-08-01 21:30:30 UTC
Please do not use MAXPATHLEN, it is a arbitrary limit, and is not defined on
GNU.  Currently this makes building gcc-4.0 fail on GNU since gcc/ada/adaint.c
assumes that MAXPATHLEN is defined.  Please do not use these kind of limits in
GNU programs.

Not having MAXPATHLEN is perfectly compliant with POSIX, same goes for
MAXHOSTNAMELEN, PATH_MAX etc.
Comment 1 Andrew Pinski 2005-08-02 01:15:08 UTC
Confirmed, it is more than adaint.c.
Comment 2 CVS Commits 2005-08-29 13:07:22 UTC
Subject: Bug 23187

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2005-08-29 13:07:07

Modified files:
	gcc/ada        : adaint.c 

Log message:
	PR ada/23187
	(GNAT_MAXPATH_LEN): Use default value if MAXPATHLEN is undefined.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/adaint.c.diff?cvsroot=gcc&r1=1.51&r2=1.52

Comment 3 Arnaud Charlet 2005-08-29 13:14:13 UTC
Should not cause compilation error any more.

Arno
Comment 4 Alfred M. Szmidt 2005-08-31 14:56:47 UTC
Subject: Re:  MAXPATHLEN usage in gcc/ada/*.c

This patch is a kludge, GNU does not have any limit what-so-ever on
the length of a filename.  And it is a horrible kludge, since it is
common to have filenames longer than 256 chars.
Comment 5 Alfred M. Szmidt 2005-08-31 15:00:17 UTC
Subject: Re:  MAXPATHLEN usage in gcc/ada/*.c

   ------- Additional Comments From charlet at gcc dot gnu dot org  2005-08-29 13:14 -------
   Should not cause compilation error any more.

The fix is wrong, GNU doesn't have any limit on the length of
filenames.  Defining a atribitary limit is not a fix.
Comment 6 Thomas Schwinge 2005-08-31 15:09:00 UTC
Reopened bug awaiting a proper fix.
Comment 7 charlet@adacore.com 2005-09-01 07:21:36 UTC
Subject: Re:  MAXPATHLEN usage in gcc/ada/*.c

> Reopened bug awaiting a proper fix.

Feel free to submit one, since you have access to a GNU system.

Arno
Comment 8 Alfred M. Szmidt 2005-10-01 16:46:02 UTC
You also have access to a GNU system, GNU/Linux.  It is easily testable there. 
Could you revert the fix?  It is better that fails loudly than having a
arbitrary limit.

I'll see about submiting a proper patch.
Comment 9 Samuel Tardieu 2008-04-12 14:44:41 UTC
Alfred, any news?
Comment 10 Samuel Tardieu 2008-11-17 20:13:18 UTC
Lowering priority, 3 years without feedback despite a new request 7 months ago.
Comment 11 Eric Botcazou 2009-03-08 09:11:35 UTC
No feedback 3 years.