shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

248
active users

#ifdef

0 posts0 participants0 posts today

(Possibly relevant to @b0rk 's interests)

So I hit a flag in diff, --unchanged-group-format. It does not show up in the manpage. It does not show up in --help. You can search both those channels for that string and you will not find it.

You know where it shows up first? If you Google it, you'll get an example in gnu.org/software/diffutils/man.

So why doesn't it show up in the manpage? Well, it does! If you read the entire manpage. With your eyes.

  -D, --ifdef=NAME                output merged file with '#ifdef NAME' diffs                                                                                                                                                                                                                                                                                                              
--GTYPE-group-format=GFMT format GTYPE input groups with GFMT
--line-format=LFMT format all input lines with LFMT
--LTYPE-line-format=LFMT format LTYPE input lines with LFMT
These format options provide fine-grained control over the output
of diff, generalizing -D/--ifdef.
LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'.

"What do you mean it isn't documented? Of course it's documented. You did read every line and do some template-substitution in your brain, didn't you?"

This isn't advocating for not reading the manpage. If you really want to understand how the tool works, you read the whole manpage. And probably the source code. 😉

... but I don't want to understand how the tool works. I want to diff two files and not have the lines that are the same get emitted.

And I think a lot of application- and solution-generating computer people, most of the time, in most of their careers, are operating on that level of depth. Problems come in too fast and with too much variety. You absolutely go deep on some things. There is no time to go deep on everything.

So how do we address this (other than throw up our hands and say "Relying on Google's fuzzy search of the whole Internet and vibe-coding LLMs is the future actually")? I don't have magic bullets, but a "fuzzy search" mode in something like less that could take an input like --unchanged-group-format and twig that it if there's no exact match, it might be related to --GTYPE-group-format would be nice.

Maybe I should mock that up in emacs. Actually, I bet someone already put it in emacs. ;)

www.gnu.orgLine Group Formats (Comparing and Merging Files)Line Group Formats (Comparing and Merging Files)
Continued thread

I would say it's the result of a badly written debug macro, ie there's a function that only prints #IFDEF DEBUG, instead of a function that's only called if DEBUG is defined.

except it takes no parameters, so that'd only work if it's a debug function that examples globals and prints about them.

which is possible, this program is global-heavy

@Petra @mcc If you're up for reading git history, a few years ago I methodically modernized a F66 text adventure to F2018. gitlab.com/apthorpe/Castleques

Refactoring away 750+ GOTO statements in the main game loop was satisfying but the last 10 or so took some pretty severe architectural modification. This code is probably a worst case scenario for untangling IF/GOTO logic.

The binary save file format from 1979 should still work and the game should play about identically to the original, though it accepts both upper and lower case commands now and the output defaults to plain text without the ASA carriage control characters. Builds on Mac, Windows, and Linux with identical source code (no #ifdef nonsense) and will create native installers for each platform if the appropriate packaging utilities are installed.

GitLabBob Apthorpe / Castlequest · GitLabGitLab.com

Differential code coverage might help next time. (It might not, because of Heisenbug effects, but it might.)

Turn code coverage on, run on arm64. Save the results somewhere. Run on x86_64. Save the results somewhere. Diff the two results -- that hopefully would give you a clue as to where it went off the rails.

You'd have to deal with things which were #ifdef'd differently for different systems, but hopefully examination of the .h files would give you a clue which routines you could ignore.

Replied in thread

@mcc true but really it was nothing more than

#ifdef vsh
[vsh code]
#endif

#ifdef fsh
[fsh code]
#endif

so really nothing crazy here, it just allows you to have everything in one file instead of having to jump between 2 (though now that you point it out, not having the ability to set breakpoints is kind of an issue here)

Replied in thread

@misty it's particularly wild because:

a.) there was so much divergence *pre*-fork; e.g., different JS engines, IDL systems, network stacks, process model, 3D subsystem, media engines, and feature set (via *many* runtime flags and #ifdef differences)

b.) that has gotten *much* larger! Since the fork, Blink rewrote the layout engine (LayoutNG), font handling, and implemented dozens of features that aren't in WebKit yet

Xcode environment question: There are a bunch of places where I need to use the main bundle ID (eg., com.kithrup.SimpleTPP) -- both in code, and in various plists (eg, for NEMachServiceName). Is there a way to use this as a variable? eg. $(whatever) in build settings, and #ifdef whatever in C-derive code, and #if whatever in Swift?