Skip to content

Instantly share code, notes, and snippets.

@bkerley
Last active May 8, 2019 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkerley/5a21aae4feb94fe9af341114c657392a to your computer and use it in GitHub Desktop.
Save bkerley/5a21aae4feb94fe9af341114c657392a to your computer and use it in GitHub Desktop.
cxx_goofin
main.dSYM
main
/*
> clang++ --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> clang++ -o main -std=c++1y -g main.cpp
> ./main
asdf
*/
#include <iostream>
#include <string_view>
struct __attribute__((packed)) cool_struct {
int first;
char second;
int third;
};
constexpr int x = 69;
constexpr char bort[] = "bort";
constexpr int y = 420;
constexpr struct cool_struct cool2 = {
.first = 32,
.second = 'x',
.third = 65535
};
int cool(std::ostream& w) {
struct cool_struct cool3 = {
.first = 15,
.second = 'y',
.third = 0xF00F
};
w << x << bort << y << cool2.second << cool3.second << std::endl;
return 1234;
}
int main() {
std::cout << "asdf" << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment