lp:mksh

Created by Thorsten Glaser and last modified

Main code repository of The MirBSD Korn Shell

Get this branch:
bzr branch lp:mksh

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Thorsten Glaser
Project:
mksh
Status:
Mature

Import details

Import Status: Reviewed

This branch is an import of the CVS module mksh from :ext:_anoncvs@anoncvs.mirbsd.org:/cvs.

The next import is scheduled to run .

Last successful import was .

Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 30 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 20 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 25 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 30 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 25 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 25 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 25 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 30 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 25 seconds — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 25 seconds — see the log

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://answers.launchpad.net/launchpad-code/+question/117193
20110610 mirabilos Imported fine, thanks!
20120216 mirabilos Fixed server-side error w.r.t. the modules file, import may be unfailed again

Updating branch...

Launchpad is processing new changes to this branch which will be available in a few minutes. Reload to see the changes.

Recent revisions

3515. By tg

report evalerr with E prefix

3514. By tg

mbccS2(FOO) for where FOO is a macro, not a parameter

3513. By tg

forbid / (and ^ as collateral) in function names

spotted by Riccardo Felici

3512. By tg

work when srcdir is below builddir viceque versa

3511. By tg

do the (0+(x)) dance for mbccChkExpr as well, compilers are idiots

3510. By tg

FAM overhaul, prodded by Jens Gustedt

via: https://digitalcourage.social/@JensGustedt/111186421403499035

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 union

mkt-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

3509. By tg

add “-c trace” option for gcc (to audit what goes into mksh-static)

3508. By tg

quell MSVC struct padding warnings for CTAs

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 antecessor

also allow the mbnil == NULL test on CFrustFrust again as the last changes
seemingly fixed it

3506. By tg

extra range check

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.