Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
I don’t think clang has a limit there that we enforce, but I wouldn’t be surprised if the practical limit is relatively low just because it’s a recursive position in the grammar and it’s natural to handle them in a million places in the compiler with recursive calls. We regularly have to chase down new bits of code that blow out the stack because they use recursion on e.g. switch cases instead of special-casing them to iterate.

Adbot
ADBOT LOVES YOU

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Yeah. I mean, given your constraints of canonical Unix-style strict-alpha paths, the simpler and much more efficient solution is just to sort them and then make a single pass dropping elements that have the last undropped element as a path-prefix (which is just string-prefix except the first character after the prefix also has to be a slash). But using an abstract path library for abstract paths is totally fine.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
switch in C is unstructured control flow. The nested statement is just an ordinary statement block, and the associated cases can be recursively anywhere inside that block except (of course) within another switch; the switch jumps to the case, entering any scopes along the way and bypassing any earlier code in that scope. (In C++, bypassing initialized declarations is illegal, but otherwise it’s the same.) The only thing special about the switch statement block is that it’s the only statement block in the language that’s never possible to enter from the top.

for is structured control flow; there are no branches into arbitrary scopes. You just keep entering the loop body from the top as long as the condition expression evaluates to true.

You can desugar a for loop into labels and goto, but at some level that’s true of any local non-conditional control flow. You could desugar if statements into a more primitive “if … goto” instead of using nested blocks, and that would indeed look a lot more like assembly language; that doesn’t mean if isn’t a structured feature, it just means it has definable semantics.

rjmccall fucked around with this message at 21:02 on Apr 10, 2024

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
You have a license for The Program. That license dictates the ways you are authorized to use and/or distribute The Program. Things that you do with The Program beyond the terms of that license are not authorized. Separating part of The Program and using it by itself is generally not going to be authorized under your license. The law is not going to draw a distinction based on it being a DLL designed to be easily separated for the convenience of the developers of The Program.

That DLL in particular is just part of an old Windows SDK, though. (It’s the HLSL compiler.) As far as I know, MS gives developers a broad license to redistribute it. So I don’t know why this would be necessary.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply