bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ununnecessary open(2) mode args


From: Chet Ramey
Subject: Re: [PATCH] ununnecessary open(2) mode args
Date: Wed, 8 Oct 2025 15:33:05 -0400
User-agent: Mozilla Thunderbird

On 10/8/25 2:14 PM, Grisha Levit wrote:
This is kind of silly, but building on Android produces a bunch of
warnings like:

This is your compiler being an annoying busybody.


lib/readline/histfile.c:626:49: warning: 'open' has superfluous mode bits; 
missing O_CREAT or O_TMPFILE? [-Wuser-defined-warnings]
   626 |   file = open (filename, O_RDONLY|O_BINARY, 0666);
       |                                                 ^

It's not a big deal but it is a bit confusing to see these modes in
the code. Is there some platform where the mode arg is used in this
situation?

That code has been there since 1991 (execpt for the cat thing). It seems
kind of silly to suddenly be worrying about it now. But I suppose it's
necessary to quite the warnings.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]