Commit graph

698 commits

Author SHA1 Message Date
Norayr Chilingarian
531bfe168b fixing Math, MathL and the ooc real math
sincos took cos as sqrt(1 - sin*sin): its sign was lost and it was
0 near pi/2 (tan(pi/2) gave large, tan(-pi) the wrong sign); REAL tan
and sin/cos reduced in LONGREAL with REAL pi and pi/2; REAL arcsin and
arccos returned their unadjusted value after any earlier error
(err stays set). in oocLowReal, scale, intpart, trunc and round
treated a REAL as a 64 bit SET (RealMath.sqrt(2) was about 1E9); now
with Reals.SetExpo and ENTIER. LowReal.small and LowLReal.small are
the exact constants again. the math test expects the right values.
2026-10-06 20:14:42 +04:00
Norayr Chilingarian
e69f33a0cd converting and writing real constants exactly
the scanner built a decimal constant digit by digit, rounding at
each step (1.1D3 was not 1100), and the code generator wrote reals
with 15 digits, so very small values came out as 0 (LowReal.small,
LowLReal.small, MathL's miny). now the scanner converts with strtod
and strtof, a constant is out of range only when its value is, and
reals are written with 17 significant digits, which read back as the
same double. MAX(REAL) and MAX(LONGREAL) are set from their bits
(MAX(LONGREAL) was 1.79769296342094D308).
2026-10-06 20:14:42 +04:00
Norayr Chilingarian
d6d99b4fbe fixing Out.Real and Out.LongReal: the exponent missed the rounding carry
the exponent digits were written before the mantissa was rounded, so
a carry into the next power of ten was lost: 0.99999999999999989
came out as 1.0D-001, and Math.sqrt(1.0) as 1.00000E-01.
2026-10-06 20:14:31 +04:00
Norayr Chilingarian
9701249ad2 adding ulm unix file and terminal streams. 2026-09-25 19:05:52 +04:00
Norayr Chilingarian
fcf59d5d93 connecting ulm standard streams to platform. 2026-09-21 15:22:53 +04:00
Norayr Chilingarian
552eade09d oocProgramArgs compatibility library. two examples. 2026-09-18 04:19:37 +04:00
Norayr Chilingarian
575ea5c236 Platform.SetFileMtime and oocFiles.SetModTime. 2026-09-18 01:46:06 +04:00
Norayr Chilingarian
0decbe950e adding LDFLAGS and LDLIBS environment variable processing. 2026-09-17 20:44:14 +04:00
Norayr Chilingarian
e661d17436 ported oocFiles compatibility library. 2026-09-17 20:43:01 +04:00
Norayr Chilingarian
c0fb40fb69 standardizing installation paths and default build. 2026-09-17 01:56:54 +04:00
Norayr Chilingarian
c985dcb3e4 ocat: fixing missing last line by flushing output after each file
console module only flushes its internal buffer on lf or when full.
files without a trailing newline silently lost their last line on exit.
switching to out module and calling out.flush after processing each file
guarantees all buffered output is written.
2026-08-01 00:28:29 +04:00
Norayr Chilingarian
4dd3c395fe adding big-endian support across compiler, runtime, and library modules
- adding Platform.LittleEndian to centralize endianness detection
- using SYSTEM.GET with correct byte offset for HUGEINT to smaller type reads on big-endian
- fixing Reals.BytesToHex iteration direction and InitEndian for big-endian
- fixing oocLowReal fraction, IsInfinity, IsNaN using Reals.Expo/SetExpo
- fixing Math.ToREAL and MathL.exponent for big-endian
- fixing In.Int and In.LongInt for big-endian
- fixing outtest.wh byte iteration direction for big-endian
- regenerating all bootstrap C sources
- tested on ppc32
2026-07-12 18:17:58 +04:00
Norayr Chilingarian
49f9e55630 fixing SYSTEM.ADDRESS cross-module parameter type mismatch
assigning adrtyp a dedicated symbol file back-reference tag (Sadr=12)
so it round-trips through symbol files as adrtyp rather than deserializing
as int32typ/int64typ, preventing false err(115) when passing procedures
with SYSTEM.ADDRESS parameters across module boundaries.
2026-07-10 04:02:57 +04:00
Norayr Chilingarian
63ec99e0bc implementing read-only value parameters using the '-' marker (oakwood guidelines 5.13)
declaring a parameter as 'name-: TYPE' passes it by reference for
efficiency but prevents assignment within the procedure body.
per xds oberon-2 documentation, '-' is a modifier on value parameters
only; combining it with VAR is an error (246).

adding 'readOnlyPar = 3' to the vis field constants on OPT.Object.
setting node^.readonly in OPB.Ident for VarPar nodes whose object
has vis = readOnlyPar, which causes OPB.Assign to emit err(76) on
any attempt to write the parameter or its components.

relaxing OPB.Param to allow passing a read-only variable as an
actual argument to a read-only formal (previously blocked by err(76)
because VarPar checked ap^.readonly unconditionally).

adding Srpar = 42 symbol file tag so that read-only parameters
survive across module boundaries: OutSign writes Srpar and InSign
reconstructs the mode and vis correctly when importing.

code generation in OPV is unchanged; read-only parameters produce
the same C as VAR parameters since the restriction is purely semantic.
2026-07-10 01:06:47 +04:00
Norayr Chilingarian
0db5141423 fixing two incompatible pointer type warnings from gcc
passing a 2d static array to an open array parameter generated no
(void*) cast, because the condition only checked for VarPar mode.
adding a check for whether the formal element type is composite
(typ^.BaseTyp^.form = OPT.Comp) catches the pointer-indirection
mismatch for nested arrays, matching the fix in ofrontplus fe43645.

assigning a pointer-to-extension to a pointer-to-base failed to
cast when the pointer type was anonymous (strobj = NIL). falling
back to casting through the base type's strobj when the pointer
type itself has no name, matching the fix in ofrontplus 69e7660.

fixes issue #105.
2026-07-09 23:50:22 +04:00
Norayr Chilingarian
f6f4c904fa fixing os name parsing from /etc/os-release for single-quoted values
gentoo (and possibly others) write ID='gentoo' with single quotes in
/etc/os-release. ParseOsRelease was only stripping double quotes and
using ascii comparison to find the end of the value, which caused
single quotes to be embedded in the os string, producing invalid oberon
like os* = ''gentoo''.

stripping both quote styles at start and stopping at either kind at end.
works for unquoted values (raspbian, devuan) and double-quoted values too.
2026-07-09 23:20:02 +04:00
Norayr Chilingarian
851aadcaf4 fixing compiler crash on dynamic array to static array assignment
the crash was introduced in aed9134e: when the rhs of an array assignment
is a pointer-dereferenced dynamic array (e.g. s^), the rhs node has no
named obj, so obj is nil. the dynArr branch in OPV was calling OPC.Len
which dereferences obj immediately, causing a segfault in the compiler.

OPV already has a Len() procedure that handles Nderef nodes by generating
ptr->len[dim] instead of relying on a named obj. switching to that call
fixes the crash and generates correct bounds-checked C code.

removing the err(113) workaround in OPB.CheckAssign that was suppressing
the crash by rejecting valid oberon-07 assignments.

fixes issue #55.
2026-07-09 23:16:59 +04:00
Norayr Chilingarian
7ffdb0859b fixed bug in function description(comment). 2026-05-06 20:28:02 +04:00
Robert Roland
9fce469f23 Fixes build problems on gcc 15
GCC 15 changes the C language standard to gnu23, and VOC compiles just fine on gnu11.

Tested against GCC 15 and GCC 14.
2026-02-03 17:43:38 -08:00
Norayr Chilingarian
84516b2ac6 prevents orphaned or misplaced comments from being written to symbol
files.
2025-07-19 05:56:37 +04:00
Norayr Chilingarian
a517a42357 comments length increased, multiline comments are also now possible. 2025-07-19 05:48:27 +04:00
Norayr Chilingarian
50b5a1438e better handling of faulty symbol files. ethStrings comments fixed. 2025-07-19 05:13:09 +04:00
Norayr Chilingarian
fa9e73f7af adapted Base64 file from Oberon S3. 2025-07-10 23:08:59 +04:00
Norayr Chilingarian
a9465ccfc6 bootstrap sources. 2025-06-24 18:27:35 +04:00
Norayr Chilingarian
dac6504f12 comments in symbol files, viewable by showdef browser. 2025-06-24 17:44:19 +04:00
Norayr Chilingarian
2f1ce08aff should fix type-bound procedure name mismatch between calls and definitions 2025-06-14 17:12:48 +04:00
Carlos Une
28c327be28 Math, MathL: add procedure fcmp 2025-05-08 15:48:46 +04:00
Inna Khachikyan
f0e92c7434 modified Index checking to handle run-time variable index containing negative value 2025-04-17 23:44:56 +04:00
sevoves
e298d10d99 rewording in configure.c 2025-04-04 15:43:44 +04:00
sevoves
3460b9f78a create macros for ignoring flood warnings 2025-04-04 15:37:41 +04:00
sevoves
b12029e3ed remove warning floods for MinGW compiler 2025-04-03 22:26:20 +04:00
sevoves
cd06cd32b1 ignore common warnings in gcc and clang 2025-04-03 22:09:20 +04:00
sevoves
7691293a5b replace egrep with grep -E for less warnings 2025-04-03 21:05:42 +04:00
Norayr Chilingarian
812b3a56d6
Merge pull request #106 from tkurtbond/openbsdinstallfailsldconfig
Don't try to uninstall the shared libraries unless the directory exists.
2025-03-13 16:19:38 +04:00
Ștefan-Iulian Alecu
b22fc3fd3f
feat: add netbsd support in configure.c 2025-03-12 02:07:15 +02:00
Norayr Chilingarian
2178fa7b18 now test server can listen on any ipv4 address. 2025-02-21 04:52:54 +04:00
Norayr Chilingarian
e36e862c8c Revert "now test server can listen on any ipv4 address."
This reverts commit afe5a2d824.
2025-02-21 04:52:20 +04:00
Norayr Chilingarian
afe5a2d824 now test server can listen on any ipv4 address. 2025-02-21 04:48:39 +04:00
T. Kurt Bond
7d14452a51 Don't try to uninstall the shared libraries unless the directory exists.
Otherwise it fails on OpenBSD during the first installation with:

    ldconfig: /usr/local/sw/versions/voc/git/lib: No such file or directory
2025-01-17 08:10:47 -05:00
Norayr Chilingarian
8d2d479664 unix nil check won't prevent windows builds. 2024-08-23 13:51:15 +04:00
Norayr Chilingarian
7fb61a066b now "NIL access" error in Modules.Mod indeed works. 2024-04-13 04:14:18 +04:00
Norayr Chilingarian
7ea99e20a0 fixed crash introduced in commit aed9134e99
see comments in OPB.Mod
2024-04-12 21:52:25 +04:00
Norayr Chilingarian
a7fe55d434 changed hardcoded test file name to the one which exists in current
directory.
2024-03-21 19:36:43 +04:00
Norayr Chilingarian
85dff7734d wrapper function for compatibility with project oberon 13 sources. 2024-03-14 18:01:26 +04:00
Norayr Chilingarian
e376e59f58 md5sum test will now work with binary files as well. 2024-02-21 03:30:49 +04:00
Norayr Chilingarian
75c155f8ec md5 sum calculation example. 2024-01-26 02:20:24 +04:00
Norayr Chilingarian
dfaf2d3622 example on how to read commandline arguments with Texts. 2024-01-14 17:15:40 +04:00
Norayr Chilingarian
ff42920226 gcc: warning: switch ‘-gstabs’ is no longer supported - removed it. 2023-10-05 17:03:30 +04:00
Norayr Chilingarian
c4213e333a small fix to build options, whitespace is necessary. 2023-10-05 17:00:23 +04:00
Norayr Chilingarian
b8d08c007a additional opts should be on the left of other CFLAGS,
this fixes linking to third party libraries issue on some operating systems
including Ubuntu and Debian, probably older gcc 11 is to blame.
Did not notice this problem on Gentoo, at least with gcc 13.
2023-10-05 16:54:37 +04:00