Re: [PATCH] Add arithmetic builtin functions

2024-12-26 Thread Paul Smith
On Mon, 2024-12-09 at 17:18 -0800, Pete Dietl wrote: > Here is a bit of test code I came up with. Do you think this is > necessary and or the right approach for testing with extreme values > of double and long long? I think the idea of setting values in config-flags.pm.in is correct, just to keep

Re: [PATCH] Add arithmetic builtin functions

2024-12-19 Thread Pete Dietl
* Poke * On Mon, Dec 9, 2024, 5:18 PM Pete Dietl wrote: > I could also use some help with autotools and the Perl test scripts < > I am a novice at both :) > > > Here is a bit of test code I came up with. Do you think this is > necessary and or the right approach for testing with extreme values o

Re: [PATCH] Add arithmetic builtin functions

2024-12-09 Thread Pete Dietl
I could also use some help with autotools and the Perl test scripts < I am a novice at both :) > Here is a bit of test code I came up with. Do you think this is necessary and or the right approach for testing with extreme values of double and long long? >From 4a6e84061fbf2180cf4efec45a215dd8af648

Re: [PATCH] Add arithmetic builtin functions

2024-12-09 Thread Paul Smith
On Mon, 2024-12-09 at 01:49 -0800, Pete Dietl wrote: > Mon, 9 Dec 2024 10:37:14 +0100, Jouke Witteveen wrote: > > What I remember from the original thread is that we first needed a > > good proposal. I'm afraid the existence of the implementation > > suggested now sidesteps the discussion on what f

Re: [PATCH] Add arithmetic builtin functions

2024-12-09 Thread Pete Dietl
Jouke, Wed, 20 May 2020 13:42:11 -0400, Paul Smith wrote: > > Another option would be to introduce some new syntax like $(()), > > but that might break existing Makefiles and would probably be more > > work, though it looks cleaner IMO. > No, I don't agree with that. Trying to change the base ma

Re: [PATCH] Add arithmetic builtin functions

2024-12-09 Thread Jouke Witteveen
On Mon, Dec 9, 2024 at 12:11 AM Paul Smith wrote: > I reviewed the previous (lengthy) email thread before looking at this > patch. I guess you mean the thread that at some point was titled "math expressions" [1]. Was there any conclusion there? At some point it gravitated to a shell/Posix-style e

Re: [PATCH] Add arithmetic builtin functions

2024-12-09 Thread Pete Dietl
Paul, Thanks for the review! 1. I will remove the use of GCC C extensions, the use of the _Generic C11 feature, and the use of compound literals. 2. I do need help getting started on the copyright paperwork though I seem to remember completing this before. At any rate, I will sign it again if nece

Re: [PATCH] Add arithmetic builtin functions

2024-12-08 Thread Paul Smith
Thanks for this work Pete! I reviewed the previous (lengthy) email thread before looking at this patch. This is a good first crack. There are a few confusing bits and we will need tests added for the various corner cases, and documentation. I can do the docs if you prefer; I usually edit them a

Re: [PATCH] Add arithmetic builtin functions

2024-12-08 Thread Paul Smith
I apologize for my tardiness in reviewing this patch; it's been a busy few weeks here. On Fri, 2024-11-29 at 12:31 -0800, Pete Dietl wrote: > > Not sure about such inline 'structs'. > > These are called "compound literals" and have been part of C since > C99. > More broadly though, what is the n

Re: [PATCH] Add arithmetic builtin functions

2024-11-29 Thread Pete Dietl
Gisle Vanem wrote: > > +#define generic_math_op(a, b, op) > >\ > > + ((void)sizeof ( > >\ > > + char[__builtin_types_compatible_p (typeof (a), typeof (b)) ? 1 : > > -1]), \ > > + _G

Re: [PATCH] Add arithmetic builtin functions

2024-11-29 Thread Gisle Vanem
Pete Dietl wrote: Here I submit to you a patch that adds the following builtin functions to make: `add` (addition), `sub` (subtraction), `mul` (multiplication), `div` (division), `mod` (modulus), `max` (maximum), `min` (minimum), and `abs` (absolute value). The implementation I provide supports