Skip to content

Instantly share code, notes, and snippets.

View mkoppanen's full-sized avatar

Mikko Koppanen mkoppanen

View GitHub Profile
#include <iostream>
class FooBar
{
public:
FooBar();
~FooBar();
};
FooBar::FooBar()
#include <iostream>
#include "FooBar.hpp"
FooBar::FooBar()
{
std::cout << "constructor" << std::endl;
}
FooBar::~FooBar()
{
class FooBar
{
public:
FooBar() {
std::cout << "bar";
}
~FooBar() {
std::cout << "foo";
}
}
#include <iostream>
#include <string>
int main(int argc, char *argv[])
{
if (argc < 2) {
std::cerr << "Usage: " << argv[0] << " <word>" << std::endl;
return EXIT_FAILURE;
}
Thread 2 (Thread 8017131c0 (LWP 100116)):
#0 0x000000080195b2ba in __error () from /lib/libthr.so.3
#1 0x000000080195afac in __error () from /lib/libthr.so.3
#2 0x0000000801955f6a in pthread_mutex_getyieldloops_np () from /lib/libthr.so.3
#3 0x0000000801956829 in pthread_mutex_trylock () from /lib/libthr.so.3
#4 0x00000008012f79e9 in _malloc_prefork () from /lib/libc.so.7
#5 0x00000008012fa031 in calloc () from /lib/libc.so.7
#6 0x0000000801955d54 in pthread_mutexattr_init () from /lib/libthr.so.3
#7 0x0000000801956001 in pthread_mutex_getyieldloops_np () from /lib/libthr.so.3
#8 0x0000000801956829 in pthread_mutex_trylock () from /lib/libthr.so.3
Program received signal SIGINT, Interrupt.
[Switching to Thread 8017131c0 (LWP 100097)]
0x00000008019a02ba in __error () from /lib/libthr.so.3
(gdb) bt
#0 0x00000008019a02ba in __error () from /lib/libthr.so.3
#1 0x000000080199ffac in __error () from /lib/libthr.so.3
#2 0x000000080199af6a in pthread_mutex_getyieldloops_np () from /lib/libthr.so.3
#3 0x000000080199b829 in pthread_mutex_trylock () from /lib/libthr.so.3
#4 0x00000008012f79e9 in _malloc_prefork () from /lib/libc.so.7
#5 0x00000008012fa031 in calloc () from /lib/libc.so.7
$ php test.php
array(3) {
["version"]=>
string(1) "3"
["eof"]=>
string(1) "^"
["eor"]=>
string(1) "~"
}
array(6) {
<?php
define("PARSING_HEADER", 1);
define("PARSING_DEFINITION", 2);
define("PARSING_DATA", 3);
define("PARSING_END", 4);
$fp = fopen("file.txt", "r");
$state = 0;
while (zmq_term(ctx, ZMQ_NOBLOCK)) {
if (errno == EAGAIN) {
// still sending
}
else {
// can't send messages
}
}
make[2]: Entering directory `/tmp/zeromq2/src'
source='clock.cpp' object='libzmq_la-clock.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../config/depcomp \
/bin/bash ../libtool --tag=CXX --mode=compile /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -g -c -o libzmq_la-clock.lo `test -f 'clock.cpp' || echo './'`clock.cpp
libtool: compile: /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -g -c clock.cpp -KPIC -DPIC -o .libs/libzmq_la-clock.o
"/opt/sunstudio12.1/prod/include/cc/stddef.h", line 51: Error: "unsigned" has already been included in this declaration.
"/opt/sunstudio12.1/prod/include/cc/stddef.h", line 51: Error: A declaration does not specify a tag or an identifier.
"/opt/sunstudio12.1/prod/include/cc/stddef.h", line 51: Error: Use ";" to terminate declarations.
"/opt/sunstudio12.1/prod/include/cc/stddef.h", line 51: Error: A declaration does not specify a tag or an identifier.
"/opt/sunstud