Pull to refresh

rethink their coding style…

Reading time 1 min
Views 15K
Выдержка из исходников gcc, файл libcpp/files.c

Copy Source | Copy HTML
  1. /* off_t might have a wider range than ssize_t - in other words,
  2. the max size of a file might be bigger than the address
  3. space. We can't handle a file that large. (Anyone with
  4. a single source file bigger than 2GB needs to rethink
  5. their coding style.) Some systems (e.g. AIX 4.1) define
  6. SSIZE_MAX to be much smaller than the actual range of the
  7. type. Use INTTYPE_MAXIMUM unconditionally to ensure this
  8. does not bite us. */
  9.    if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t))
  10.    {
  11.       cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path);
  12.       return false;
  13.    }
  14.  
  15.       size = file->st.st_size;
Tags:
Hubs:
+58
Comments 15
Comments Comments 15

Articles