- Rust has the same memory problem as C and C++ - 5 Updates
- Community service -- do not pass Go ... - 6 Updates
- Wish Dan Cross well. His ex boyfriend Chuck Martin passed away. - 1 Update
- How to use extern C with _Bool - 2 Updates
Juha Nieminen <nospam@thanks.invalid>: Apr 25 05:04PM > Certainly it is not the case that 99% of C programs are valid C++ > programs. That number is closer to 0%. Can you explain why? I can't immediately think of a reason why no C program would be valid C++ without modification (especially now that the standardization committee decided that standard headers inherited from C with names in the form of <name.h> are valid and will put everything in the global namespace.) |
Jorgen Grahn <grahn+nntp@snipabacken.se>: Apr 25 06:36PM On Sat, 2020-04-25, Juha Nieminen wrote: > that the standardization committee decided that standard headers > inherited from C with names in the form of <name.h> are valid and > will put everything in the global namespace.) I'm more interested in why people /care/. This topic generates a lot of heat, over and over again ... but as I see it, pretty much everyone[0] has a C compiler and a C++ compiler, and will compile their C code with the former and their C++ code with the latter. The ability to use C libraries from C++ (without any glue) matters though. /Jorgen [0] Not everyone. -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Apr 25 03:15PM -0700 > that the standardization committee decided that standard headers > inherited from C with names in the form of <name.h> are valid and > will put everything in the global namespace.) One common reason is that C code typically doesn't cast the result of malloc(), but C++ does not permit implicit conversion from void* to (other) object pointer types. Another is that C++ string literals are const, so this: char *s = "hello"; is invalid C++. A less common reason might be C code that uses C++ keywords as identifiers. (I've occasionally done this deliberately.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */ |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Apr 25 03:28PM -0700 On 4/23/2020 11:13 PM, Juha Nieminen wrote: >> with just <complex>. double damn! ;^o > While you are at it, maybe change the calloc() to a std::vector? > Much simpler, and shouldn't have much of an impact on performance. Big time. It would be nice to have a destructor in there to automatically destruct the vector, ahh shit!, std::vector. ;^) |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Apr 25 03:31PM -0700 On 4/23/2020 3:10 PM, Alf P. Steinbach wrote: >> Yup! I totally forgot to add std:: to many function calls! Damn. I was >> quickly porting this from C over to C++, and it slipped my mind. ;^o > Always compile with at least 2 compilers, if possible. Indeed! I was only working with GCC. Iirc, MSVC might compile it as well. |
Ian Collins <ian-news@hotmail.com>: Apr 25 12:54PM +1200 On 24/04/2020 19:21, David Brown wrote: > and has been predicted to replace them for nearly 10 years, but is still > seen almost nowhere. Just as IPv6 is only found either on specialised > or highly technical local networks, ... Or in India and Japan! -- Ian. |
Tim Rentsch <tr.17687@z991.linuxsc.com>: Apr 25 12:27AM -0700 > that the percentage of routers with SCTP support was > very low as of 2013. Thanks in advance for advice > on this. Using linux makes a great router. SCTP is available for Linux. Raspberry Pi runs Linux. Some models of Raspberry Pi have WiFi built in (admittedly with limited range, but should be enough for a wireless repeater if you need that). If you need a real network center, couple the Raspberry Pi with a multilayer managed switch. Cisco SG350-10 is available on Amazon for $144. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 25 02:17PM +0100 > Brian > Ebenezer Enterprises - In G-d we trust. > https://github.com/Ebenezer-group/onwards Your fucking god doesn't fucking exist. Stop pushing that snake oil here; you are just as egregious as Trump. /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
woodbrian77@gmail.com: Apr 25 11:31AM -0700 On Saturday, April 25, 2020 at 2:28:02 AM UTC-5, Tim Rentsch wrote: > If you need a real network center, couple the Raspberry Pi > with a multilayer managed switch. Cisco SG350-10 is > available on Amazon for $144. Thanks for your comments. I would probably use FreeBSD rather than Linux for that. I'm trying to avoid Amazon. One alternative I've found is https://www.bhphotovideo.com . Their prices are often better than Amazon's if you have their card. I should add them to my recommended sites page. Brian Ebenezer Enterprises http://webEbenezer.net |
woodbrian77@gmail.com: Apr 25 11:50AM -0700 On Saturday, April 25, 2020 at 8:17:59 AM UTC-5, Mr Flibble wrote: Don't swear here, please. I didn't vote for Clinton, Bush, Obama, Hillary or Trump. I've been voting for the Constitution Party candidates. |
red floyd <no.spam@its.invalid>: Apr 25 01:36PM -0700 > Don't swear here, please. > I didn't vote for Clinton, Bush, Obama, Hillary or Trump. > I've been voting for the Constitution Party candidates. Fuck off trying to impose your morals on everyone else. |
cdalten@gmail.com: Apr 25 12:34PM -0700 Some of you might not realize this, but Dan Cross is bisexual. He is currently married to a woman. But he always had feeling for his ex boyfriend Chuck Martin. Anyways, Dan hasn't really been himself since Chuck passed away a few days ago. I'm sure Dan would appreciate it if you emailed him at crossd@gmail.com and tell him that he will meet his ex boyfriend again in heaven. |
Tim Rentsch <tr.17687@z991.linuxsc.com>: Apr 25 12:31AM -0700 > My understanding in C is that "bool" is a typedef for "_Bool". But > is "_Bool" just a regular 'int' or is it something smaller (e.g. > char) ? Just use int. You know int will work, without having to worry about possible incongruities between _Bool/bool, headers, etc. Also, if the parameter type is bool, then because of conversion rules it would be allowed to pass pointers as arguments. My guess is you don't want to allow passing pointers as arguments. |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Apr 25 10:24AM +0200 On 23.04.2020 13:50, Frederick Gotham wrote: > extern "C" int EnableDebug(int); > My understanding in C is that "bool" is a typedef for "_Bool". But > is "_Bool" just a regular 'int' or is it something smaller (e.g. char)? Use the first one. And if you feel it necessary, add something like #ifdef __cplusplus static_assert( c_bool_size = sizeof( bool ) );
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment