How can I define a string literal on the GCC command line?

Two options. First, escape the quotation marks so the shell doesn’t eat them: gcc -Dname=\”Mary\” Or, if you really want -Dname=Mary, you can stringize it, though it’s a bit hacky. #include <stdio.h> #define STRINGIZE(x) #x #define STRINGIZE_VALUE_OF(x) STRINGIZE(x) int main(int argc, char *argv[]) { printf(“%s”, STRINGIZE_VALUE_OF(name)); } Note that STRINGIZE_VALUE_OF will happily evaluate down to … Read more

How to override the `project.build.finalName` Maven property from the command line?

See Introduction to the POM finalName is created as: <build> <finalName>${project.artifactId}-${project.version}</finalName> </build> One of the solutions is to add own property: <properties> <finalName>${project.artifactId}-${project.version}</finalName> </properties> <build> <finalName>${finalName}</finalName> </build> And now try: mvn -DfinalName=build clean package

Git is not working after macOS update (“xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools”)

The problem is that Xcode Command-line Tools needs to be updated due to OS update. ** UPDATED for Ventura and updated apple dev download page ** After opening the terminal after a restart, I tried to go to my code, and do a git status, and I got an error and prompt for command line … Read more