GCC documented FILENAME_MAX is the maximum length of a file that can be opened, not to be used for allocation as it may be INT_MAX for e.g. Even though this wasn't the case on supported systems, prefer FILE_MAX which is used for full paths in most places.