From 5ffa45661c50be1e6d384156be9b83fbed1356b3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 24 Apr 2017 19:01:33 -0500 Subject: Another FAQ, and some related tweaks as long as I was there. --- www/design.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'www/design.html') diff --git a/www/design.html b/www/design.html index 37838be9..707596bc 100644 --- a/www/design.html +++ b/www/design.html @@ -303,8 +303,8 @@ effort on them.

We depend on C99 and posix-2008 libc features such as the openat() family of functions. We also assume certain "modern" linux kernel behavior such -as large environment sizes (linux commit b6a2fea39318, went into 2.6.22 -released July 2007). In theory this shouldn't prevent us from working on +as large environment sizes (linux commit b6a2fea39318, went into 2.6.22 +released July 2007). In theory this shouldn't prevent us from working on older kernels or other implementations (ala BSD), but we don't police their corner cases.

@@ -316,9 +316,8 @@ in embedded devices for several more years.

Toybox relies on the fact that on any Unix-like platform, pointer and long are always the same size (on both 32 and 64 bit). Pointer and int are _not_ -the same size on 64 bit systems, but pointer and long are.

- -

This is guaranteed by the LP64 memory model, a Unix standard (which Linux +the same size on 64 bit systems, but pointer and long are. +This is guaranteed by the LP64 memory model, a Unix standard (which Linux and MacOS X both implement, and which modern 64 bit processors such as x86-64 were designed for). See the LP64 standard and @@ -335,7 +334,8 @@ platforms like arm, char defaults to signed. This difference can lead to subtle portability bugs, and to avoid them we specify which one we want by feeding the compiler -funsigned-char.

-

The reason to pick "unsigned" is that way we're 8-bit clean by default.

+

The reason to pick "unsigned" is that way char strings are 8-bit clean by +default, which makes UTF-8 support easier.

Error messages and internationalization:

@@ -373,6 +373,9 @@ of it.)

Locale support isn't currently a goal; that's a presentation layer issue (I.E. a GUI problem).

+

Someday we should probably have translated --help text, but that's a +post-1.0 issue.

+

Shared Libraries

Toybox's policy on shared libraries is that they should never be @@ -486,7 +489,7 @@ varargs), "if (function() != NULL)" is the same as "if (function())",

The goal is to be concise, not cryptic: if you're worried about the code being hard to understand, splitting it to multiple steps on multiple lines is -better than a NOP operation like "!= NULL". A common sign of trying to +better than a NOP operation like "!= NULL". A common sign of trying too hard is nesting ? : three levels deep, sometimes if/else and a temporary variable is just plain easier to read. If you think you need a comment, you may be right.

-- cgit v1.2.3