Questions tagged [anonymous-namespace]

3 questions
0
votes
1 answer

Strange behavior (anonymous namespace with swscanf)

I have the next experimental code. That code fail with segmentation fault on the labeled line. If I take out the str2MxfKey function from anonymous namespace or give a some name to namespace, code will run without any problem. That strange behavior…
0
votes
0 answers

Should I put my using declarations in the anonymous namespace?

When implementing a function in CPP, I am used to put my helper functions in an anonymous namespace, so they don't pollute the global namespace outside the CPP file where they are defined. However, the same doesn't seem to apply to using…
Antonio
  • 355
  • 1
  • 2
  • 13
-1
votes
1 answer

Should I convert C static function to private member function or free function in unnamed namespace?

I want to update some C legacy code to C++. Suppose I had something similar to this code in C: //my_struct.h typedef struct myStruct { //some members go here } myStruct; int f1(myStruct*); void f2(myStruct*); //my_struct.c #include…
vmp
  • 2,370
  • 1
  • 13
  • 17