On Wed, 2015 May  6 20:22+0000, Thorsten Glaser wrote:
> Daniel Richard G. dixit:
>
> Unless we convert EBCDIC to Unicode ourselves (as opposed to letting
> the system do it; I’m currently convinced that we really want to do
> this actually, since we don’t support them all anyway).

If you bundle a set of encoding tables with mksh (whether transformed
into C arrays or loaded as-is at runtime), you can easily support every
variant of EBCDIC that matters. Just look at "iconv -l" on Linux, for
example; it's not like this would be a hard problem.

> >If all of mksh's input/output is being filtered via conversion tables
>
> It isn’t, it never is. That would just be insane ;-) Only some.

Well, filtering everything would sure make some interesting
things possible.

(Maybe it's feasible, if you plan it that way from the start. Use
strerror()+convert instead of perror(), and so on. Food for thought ;)

> >I think that sounds right. Maybe call the binary "emksh"? As much as
>
> Okay, emksh and EBCDIC [ML]KSH it is.

Sounds good!

Down the line, if mksh ever gains features that are particular to z/OS---
like being able to interface with parts of the system that are outside
of the OMVS Unix environment---then this may be something to revisit.
But as long as it's just using the normal POSIX interface,
distinguishing it by the use of EBCDIC is the right way to go, IMO.


So, everything seems in order here. I see you've merged in many of the
changes already. Is there anything more you need from me at this time?
I'll be happy to test a pristine tree on z/OS once all the necessary
tweaks are in.

I did want to pass one thing along for now, amending my original patch.
It turns out that xlc on z/OS does in fact support -qro and -qroconst;
it's only -qroptr that is unsupported. Small oversight on my part.

Also, while this xlc doesn't have -qcheck, it does have -qrtcheck:

         -qrtcheck[=<option>] | -qnortcheck
                Generates compare-and-trap instructions that
                perform certain types of runtime checking. The
                available options are:

                all  Automatically generates compare-and-trap
                     instructions for all possible runtime checks.
                bounds
                     Performs runtime checking of addresses when
                     subscripting within an object of known size.
                divzero
                     Performs runtime checking of integer division.
                nullpr
                     Performs runtime checking of addresses
                     contained in pointer variables used to
                     reference storage.

                The default is -qnortcheck.

That seems to be in the same spirit, so I threw it in. Your call if
you'd like to use it, of course.


> >Very nice hack! I do prefer analog clocks myself.
>
> ;-)
>
> I don’t care as long as the clock also shows the day and month, and
> preferably also the day-of-week. I tend to not know them. Oh, and,
> i̲f̲ I have a clock, it better go right, so it should do NTP or DCF77
> (sadly, most DCF77 clocks only sync once a day or month or when you
> trigger it manually, not constantly, so they are off most of the
> time, especially when they are often in buildings that shield radio
> signals well).

It's certainly easy enough to get WWVB radio clocks here in the States,
though if you live in the edges of the continent, you'll have a hard
time getting the signal. I like date information too, but good luck
finding that in an analog model bigger than a wristwatch!


--Daniel


-- 
Daniel Richard G. || sk...@iskunk.org
My ASCII-art .sig got a bad case of Times New Roman.
Index: Build.sh
===================================================================
RCS file: /cvs/src/bin/mksh/Build.sh,v
retrieving revision 1.678
diff -u -r1.678 Build.sh
--- Build.sh	29 Apr 2015 20:44:55 -0000	1.678
+++ Build.sh	8 May 2015 02:34:44 -0000
@@ -1493,10 +1513,27 @@
 	ac_flags 1 extansi -Xa
 	;;
 xlc)
-	ac_flags 1 rodata "-qro -qroconst -qroptr"
-	ac_flags 1 rtcheck -qcheck=all
-	#ac_flags 1 rtchkc -qextchk	# reported broken
-	ac_flags 1 wformat "-qformat=all -qformat=nozln"
+	case "$TARGET_OS" in
+	OS/390)
+		# On IBM z/OS, the following are warnings by default
+		# CCN3296: #include file <foo.h> not found.
+		# CCN3944: Attribute "__foo__" is not supported and is ignored.
+		# CCN3963: The attribute "foo" is not a valid variable
+		#          attribute and is ignored.
+		ac_flags 1 halton "-qhaltonmsg=CCN3296 -qhaltonmsg=CCN3944 -qhaltonmsg=CCN3963"
+		# CCN3290: Unknown macro name FOO on #undef directive.
+		# CCN4108: The use of keyword '__attribute__' is non-portable.
+		ac_flags 1 supprss "-qsuppress=CCN3290 -qsuppress=CCN4108"
+		ac_flags 1 rtcheck -qrtcheck=all
+		;;
+	*)
+		ac_flags 1 roptr "-qroptr"
+		ac_flags 1 rtcheck -qcheck=all
+		#ac_flags 1 rtchkc -qextchk	# reported broken
+		ac_flags 1 wformat "-qformat=all -qformat=nozln"
+		;;
+	esac
+	ac_flags 1 rodata "-qro -qroconst"
 	#ac_flags 1 wp64 -qwarn64	# too verbose for now
 	;;
 esac

Reply via email to