- Can extern "C" functions throw exceptions - 2 Updates
- Has "stack overflow" specified behavior? - 1 Update
| Richard Damon <Richard@Damon-Family.org>: Dec 14 09:17PM -0500 On 12/14/21 6:21 PM, Tim Rentsch wrote: > is a link to stackoverflow with more information: > https://stackoverflow.com/questions/26647259/ > is-extern-c-a-part-of-the-type-of-a-function Maybe a better way of saying that is most platform ABIs don't allow for a difference, because it would break too much existing code. Few implementations are designed in a vacuum, most have an ABI they need to conform to (or multiple ones to select between with options). Only when a brand new platform comes out do we have the ability to really inovate on an ABI, and even then inertia tends to restrict it. |
| "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu>: Dec 14 07:06PM -0800 On Tuesday, December 14, 2021 at 6:21:38 PM UTC-5, Tim Rentsch wrote: > "james...@alumni.caltech.edu" <james...@alumni.caltech.edu> writes: ... > > [...] > Thank you for this citation. It doesn't answer all my questions > but it certainly does provide an illuminating example. If you can figure out words to express your remaining questions, I'd be curious to find out what they are. > is a link to stackoverflow with more information: > https://stackoverflow.com/questions/26647259/ > is-extern-c-a-part-of-the-type-of-a-function The standard is quite clear: "Two function types with different language linkages are distinct types even if they are otherwise identical." (9.11p1). I'm annoyed, but unfortunately not surprised, to find that this has been ignored. I've never had any need to write code where that issue would matter, which is why I've never noticed. |
| "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Dec 14 03:23PM -0800 On 12/14/2021 8:14 AM, Ben Bacarisse wrote: > In the most general cases, yes, but some languages actually specify that > certain recursive calls will not use a new data frame. (The point being > that recursion does not always require a stack.) Fwiw, when I write something that's recursive, I always end up thinking about how to create an iterative version of it. Here is the iterative version of a recursive fractal I created a while back: https://pastebin.com/raw/0B7rNx9Z ______________________ // Fractal Parametric Wave Plotter void ct_fwave_mpara( ct::plot2d& plot, unsigned int n, ct_complex p0, ct_complex p1, unsigned int nr ) { ct_complex dif = p1 - p0; // Build the Fractal wave ct_float abase = 1.0 / n; ct_float abase_wave = CT_PI * 1 / n; for (unsigned int i = 0; i < n; i++) { ct_float angle = abase * i; ct_float angle_wave = abase_wave * i * nr; ct_float y_temp = abs(sin(angle_wave)) * 1.0 / nr + (p0.imag() + (dif.imag() * angle)); // Fractal Wave High ct_complex wp0 = { p0.real() + (dif.real() * angle), y_temp }; // Fractal Wave Low ct_complex wp1 = { p0.real() + (dif.real() * angle), -y_temp }; plot.set_pixelf(wp0, CT_RGBF(1., 1., 0.)); plot.set_pixelf(wp1, CT_RGBF(0., 1., 1.)); } } // Fractal Parametric Wave Function void ct_fwave( ct::plot2d& plot, unsigned int n, ct_complex p0, ct_complex p1, unsigned int nr ) { // For every level for (unsigned int recur_i = 0; recur_i < n; ++recur_i) { // Plot the wave ct_fwave_mpara(plot, 3072, p0, p1, nr); // Compute next wave nr = nr * (recur_i + 2); } } ______________________ |
| You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment