Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455477

Re: [PATCH 1038/1285] Replace numeric parameter like 0444 with macro

From Theodore Ts'o <tytso@mit.edu>
Newsgroups linux.kernel
Subject Re: [PATCH 1038/1285] Replace numeric parameter like 0444 with macro
Date 2016-08-02 23:20 +0200
Message-ID <s1Pgt-1Bc-5@gated-at.bofh.it> (permalink)
References <s1IRJ-5C1-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 02, 2016 at 08:10:47PM +0800, Baole Ni wrote:
> I find that the developers often just specified the numeric value
> when calling a macro which is defined with a parameter for access permission.
> As we know, these numeric value for access permission have had the corresponding macro,
> and that using macro can improve the robustness and readability of the code,
> thus, I suggest replacing the numeric parameter with the macro.

I actually find using the macros significantly **decrease* the
readiability of the code.  A quick glance at 0644 quickly tells you
what the permissions are.  Parsing S_IRUSR | S_IRGRP | S_IROTH takes
longer, and is more error prone.

NACK.

					- Ted

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1038/1285] Replace numeric parameter like 0444 with macro Baole Ni <baolex.ni@intel.com> - 2016-08-02 16:30 +0200
  Re: [PATCH 1038/1285] Replace numeric parameter like 0444 with macro Theodore Ts'o <tytso@mit.edu> - 2016-08-02 23:20 +0200

csiph-web