Re: style change: explicitly permit braces for single statements

2020-07-11 Thread Nick Hudson

On 12/07/2020 04:01, Luke Mewburn wrote:

On 20-07-12 10:01, Luke Mewburn wrote:
   | I propose that the NetBSD C style guide in to /usr/share/misc/style
   | is reworded to more explicitly permit braces around single statements,
   | instead of the current discourgement.
   |
   | IMHO, permitting braces to be consistently used:
   | - Adds to clarity of intent.
   | - Aids code review.
   | - Avoids gotofail: 
https://en.wikipedia.org/wiki/Unreachable_code#goto_fail_bug
   |
   | regards,
   | Luke.

I was asked to CC this thread to tech-kern@, so I'm doing that.



yes please

Nick


Re: _UC_MACHINE_BP

2018-02-09 Thread Nick Hudson

On 02/09/18 02:47, Christos Zoulas wrote:

In article ,
Valery Ushakov  wrote:

Kamil Rytarowski  wrote:


I propose to add a definition of _UC_MACHINE_BP() across the ports in
/usr/include/*/mcontext.h.

BP stands for Base Pointer / Frame Pointer.

Please, s/BP/FP/.  "Frame pointer" is an esablished name and several
assemblers use "fp" as a register name/alias (e.g. vax, sparc); "base
pointer" it too vague; clashes with "breakpoint".

Yes, FP is better alhough it clashes with Floating Point :-)


It does?

_REG_FP is defined by at least arm and vax.

Nick


Re: dlopen interception on libasan

2016-11-30 Thread Nick Hudson

On 11/30/16 14:37, Christos Zoulas wrote:

On Nov 30,  7:34am, sk...@netbsd.org (Nick Hudson) wrote:



[incorrect test deleted]


You did not define dlopen() in your own shared object; libasan needs to
do that to override the default definition. This is not the right test.


OK, so... add something like

https://nxr.netbsd.org/xref/src/libexec/ld.elf_so/symbol.c#565

to

  https://nxr.netbsd.org/xref/src/libexec/ld.elf_so/rtld.c#1125


?


Nick