On Tue, Nov 24, 2026 at 02:43:41PM -0300, Diego Nieto Cid wrote:
> >  
> >  off_t tmpfs_page_limit, tmpfs_space_used;
> > +off_t tmpfs_size_limit = UINT_MAX;
> 
> There doesn't seem to be any other assignment to this
> variable and only one usage. I can't see its purpose.
>

Also:

    off_t is used for describing file sizes.
    It is a signed integer type.

Assigning it UINT_MAX (unsigned) should make the compiler
scream, with the right flags :-)

For instance,

    $ cat a.c
    #include <sys/types.h>
    #include <limits.h>
    off_t a = UINT_MAX;
    $ i686-gnu-gcc -Wconversion -Wall -c -o a.o a.c
    a.c:3:11: warning: signed conversion from 'unsigned int' to 'off_t' {aka 
'long int'} changes value from '4294967295' to '-1' [-Wsign-conversion]
        3 | off_t a = UINT_MAX;
          |           ^~~~~~~~


Thanks.

Reply via email to