lp://staging/mksh
Main code repository of The MirBSD Korn Shell
- Get this branch:
- bzr branch lp://staging/mksh
Branch merges
Branch information
Import details
This branch is an import of the CVS module mksh from :ext:_anoncvs@anoncvs.mirbsd.org:/cvs.
Last successful import was .
Whiteboard
20100709 maxb Approved
20100709 maxb It looks like we'll need the LOSAs to manually accept the ssh host key, suspending for now - pending https:/
20110610 mirabilos Imported fine, thanks!
20120216 mirabilos Fixed server-side error w.r.t. the modules file, import may be unfailed again
Recent revisions
- 3510. By tg
-
FAM overhaul, prodded by Jens Gustedt
via: https:/
/digitalcourage .social/ @JensGustedt/ 111186421403499 035 mbsdint.h:
• assign mbiSIZE_MAX to mbccSIZE_MAX once we have determined it
(note loading mbsdint.h is also good near mbsdcc.h top)mbsdcc.h:
• move offsetof monkey-fix here from mksh/sh.h (for old klibc/dietlibc
on GCC or NWCC (Nils Weller’s) where it’s broken and we can just
redirect to the compiler builtin); safe since <stddef.h> was just read
• introduce mbccSIZE_MAX and document at the beginning that including
<basetsd.h> or <limits.h> first is useful
• introduce mbccABEND(msg) which users are supposed to provide/override,
not call, but which we can call from within our “run-time” macros
• introduce mbccChkExpr(x) which is a sort of compile-time check that
works within an expression / function-like cpp macro, even on CFrustFrust
(boy t̲h̲a̲t̲ was hard) and evaluates to 0
• add mbccCEX(x) which ensures its argument is compile-time constant
(and which itself also is); we do not need the Linux __is_constexpr
but a compile error here
• rename mbccFAM to mbccFAMslot
• add mbccFAMSZ (compile-time) and mbccFAMsz (run-time) to calculate the
minimum length of an object for a struct with a FAM of the given size
‣ arguments: struct foo, member, size-in-chars
‣ size-in-chars is mbccCEX’d by mbccFAMSZ so it’s usable in definitions
like a storage union itself
‣ the return value of mbccFAMSZ/mbccFAMsz, size_t, is roughly the same
as the offsetof method recommended before, but (by Jens) has a lower
bound of sizeof(struc), so its trailing padding will be guaranteed to
be present if the FAM is tiny enough
‣ also, check that sizeof(struc) + size-in-chars fits mbccSIZE_MAX
→ compile-time for mbccFAMSZ
→ run-time with mbccABEND for mbccFAMsz
this also came from mksh (checkoktoadd etm.)
• add more FAM examples:
‣ nōn-char type, with sizeof(type[cnt]) which while feeling unnatural
has a lower chance of corner cases than sizeof(type) * (size_t)cnt…
‣ storage unionmkt-int.sh (testsuite): extend accordingly where plausible
‣ at some point we’ll want to add “negative tests”, i.e. tests for
where compilation must error out…mksh:
• change most offsetof to mbccFAMSZ where possible else mbccFAMsz
‣ 1 → 1U etc. while here
‣ also, alloc1 → alloc where suitable, given mbccFAMsz also checks now
• tempfile pathname template string cleanup while here
• follow mbccFAMslot renaming
• provide kerrf-based mbccABEND - 3507. By tg
-
turns out MSVC dislikes offsetof(struct s, label[0])
but offsetof(struct s, label) is fine; it considers the latter a
run-time thing, apparently (we test they are identical in mkt-int.sh now)drop MKSH_BROKEN_
OFFSETOF in the same go, because it applied to SCO and
Xenix only, which were probably using MSVC’s antecessoralso allow the mbnil == NULL test on CFrustFrust again as the last changes
seemingly fixed it - 3505. By tg
-
split compiler support off into mbsdcc.h and keep mbsdint.h for integer fix
we can use mbsdcc.h for CTAs etc. in conf tests now too
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)