GCC Poison
blog.leafsr.com
blog.leafsr.com
Can we please, please stop breaking shit that worked just fine in '95?
(to prevent confusion: this is a parody of the site MBlume linked)
Not the author's fault (apart from choosing to use Blogger), but wow, how do you fuck web design up that badly? It's just a blog, a few paragraphs and links to more articles, it doesn't need to be an entire fucking web app complete with 5 other useless ways to view a list of summaries (Pinterest is big right now, people love grids, right? Here, let me smack you in the face with this stupid zooming JQuery effect).
Now the pioneer of JS apps doesn't even bother trying to put <noscript>There is usually a blog post here if you are using javascript</noscript>
Because I feel your pain, I wrote you a quick, dirty fix.
# how to fetch a blogger.com blog
# without the gratuitous javascript
# usage: nameofthisfile blog.whatever.com > html_file
#! /bin/sh
case $# in
1)
{
a=${1%%/*}
printf "%b" "GET / HTTP/1.1\r\n";
printf "Host: ${a##http://}\r\n";
printf "Connection: Close\r\n";
printf "\r\n";
} \
|nc -vv $1 80 \
|sed '
/targetBlogID/!d;
s/.*targetBlogID=//;
s/&.*//;
' \
|while read a
do
{
printf "%b" "GET /feeds/$a/posts/default HTTP/1.1\r\n";
printf "Host: www.blogger.com\r\n";
printf "Connection: Close\r\n";
printf "\r\n";
} \
|nc -vv www.blogger.com 80 \
|sed '
s/</</g;
s/>/>/g;
s/&/\&/g;
s/"/\"/g;
1i\
<br><br>
s/<name>/<br><br>name &/g;
s/<uri>/<br>uri &/g;
s/<generator>/<br>generator &/g;
s/<id>/<br>id &/g;
s/<published>/<br>published &/g;
s/<email>/<br>email &/g;
s/<title type=.text.>/<br><br>&/g;
s/<openSearch:totalResults>/<br>total results &/g;
s/<openSearch:startIndex>/<br>start index &/g;
s/<openSearch:itemsPerPage>/<br>items per page &/g;
s/<updated>/<br>updated &/g;
s/<thr:total>/<br>thr:total &/g;
s/<\/feed>/&<br><br><br>/;
'
done
;;
*)
echo usage: $0 blog.whatever.com >&2
esachttp://unspecified.wordpress.com/2009/05/16/microsoft-bans-m...
http://msdn.microsoft.com/en-us/library/dswaw1wk(v=vs.80).as...
edit: I read the link you included and I have to take exception with this line:
it’s a perfectly safe function if you use
it properly
Sure, same thing as automobiles, alcohol, condoms… Problems arise because people do not use them correctly."If the source and destination overlap, the behavior of memcpy_s is undefined."
Wow, way to improve things microsuck! It's not like anyone has ever mistakenly used memcpy on overlapping buffers....
you know memcpy is my 'classical' example of why you should never trust library code to be well optimised. its almost always a dumbass byte-by-byte copy - its pretty much the worst case performance unless you go out of your way to slow down your implementation.
the speed improvement from good register usage and appropriate cache hints was >35% the last time i had to do this (iirc against the VS 2008 implementation)
MS provided a special memcpy variant for 360 that did this for you using the PPC dcb* instructions and good use of the wider registers.
http://nadeausoftware.com/articles/2012/05/c_c_tip_how_copy_...
no memcpy implementation has an excuse to be that slow under any compiler imo.
i'd imagine the intel guys will make use of this stuff because its why they put it in the hardware to start with... :)
incidentally, as a complete tangent, really great bunch of guys to work with if you get the chance - at least in my experience. a definite passion for and focus on performance in a serious way. :)
And most of what's in ANSI C (the first C standard, before ISO stepped in, from 1989) was in C compilers before ANSI C existed. I think void and void* were the only things ANSI C really added to the language.
My point is, the C standards body likes to standardize common usage, and 'what a Microsoft compiler does' is pretty close to being common in some parts of the world.
Didn't the POSIX standard do that, as opposed to the ANSI C standard?
It's a little amusing that MS have this optional part of C11 implemented years in advance and standardised on their work, but haven't got C99 support. It must suit them to have it that way.
Can you tell me whether the C11 Bounds checking stuff from this optional Annex K had fully made it in to GCC 4.9? If not what's missing?
On the status page here it implies the project has had issues:[0]
[0]http://gcc.gnu.org/wiki/C11Status
Yet, on the release notes it says "Substantially complete" but it's really as clear as mud whether it's all there[2].
[2]http://gcc.gnu.org/gcc-4.9/changes.html
I suppose that on Linux and Windows the intel compiler relies on the GCC/MS implementation of memcpy_s.
#define const_cast CONST_CAST_IS_FORBIDDEN #define dynamic_cast DYNAMIC_CAST_IS_NEVER_NECESSARY
etc...
its dirty, but it gets the job done
C-style cast at least doesn't make you pay through the nose in debug time or performance overheads - even if it is easily confusing :)
Fix the tools, don't blame people for using them as best they know how.
So sure, you can say that people shouldn't write in C if they can't call memcpy safely, but the truth is that people do and mistakes do get made.
It takes a lot of effort and care to make sure that memcpy is never used to copy data that isn't too large for the destination buffer and there are alternatives like mempcpy and memccpy.
Empirically, in my experience, a much higher risk is an integer overflow in the allocation in question. Rather than memcpy_s, I'd prefer a malloc_s that takes a count and element size - like calloc, but without zeroing the buffer, so it doesn't feel like a performance waste to use when that isn't required.
I'd rather just do the overflow checking before arithmetic.
These functions have no right to exist.
char dst[5];
sprintf(dst, "%.*s", (int)sizeof(dst)-1, "Hello!");
Copies a null-terminated string to dst, truncating if necessary to avoid overflow.Just don't forget the "." or the "-1".
And by a long time I mean before 1989 (certainly before 1999).
But banning gets is obvious because it is by definition facing external input
(It is perfect with no sidebar on Dolphin/Note 2. Arstechnica on the other hand has been broken for a few days already.)
My theory (based purely on using the site, mind you) is that the all the crazy dynamic display stuff in Blogger (before that, it was a much more normal/boring blogging platform) was one last hurrah before the project was relegated to "legacy barely-maintained-mode," and that it hasn't had proper testing in years...
Given that, I think really the best thing would be if they come up with a way to integrate it into Google+ and retire Blogger as a platform. Hopefully they'd add some more features[1] to G+ to keep the functionality roughly equivalent and support the longer-form type of article which is more common on blogs, and keep the domain and blog identities from Blogger around as a thin skin. At least then it would be well maintained.
[1] E.g. better markdown support, multiple embedded images, some sort of easier access to older articles (Blogger lets you browse by year/month), etc.
http://linux.die.net/man/1/gcc
-include file Process file as if "#include "file"" appeared as the first line of the primary source file. However, the first directory searched for file is the preprocessor's working directory instead of the directory containing the main source file. If not found there, it is searched for in the remainder of the "#include "..."" search chain as normal. If multiple -include options are given, the files are included in the order they appear on the command line.