Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
c:\>copy con program.exe
$ cat <<EOF > filename
> line 1
> line 2
> EOF
>, чем объяснять, что его там нет. А то PS2 может быть разным.cat << EOF интересен не тем, что не нужны «магические» комбинации клавиш (кстати, stty eof $new позволит вам поменять <C-d> на что‐то другое). А тем, что, во‐первых, может быть использован в скриптах (<C-d> нельзя), во‐вторых, использует zle/readline/libedit/…, позволяя вносить правки в текущую строку, и, в‐третьих, полностью сохраняются в истории (т.е. можно вносить правки после запуска команды, хотя работа с многострочным вводом в оболочках не слишком удобна, да и именно код после << EOF сохраняют не все).А в наше время писалось что-то типа
while (true)
{
fork();
}#if (WINVER >= 0x0500)
WINGDIAPI DWORD WINAPI GetLayout(HDC);
WINGDIAPI DWORD WINAPI SetLayout(HDC, DWORD);
#endif
#include <windows.h>
WINGDIAPI DWORD WINAPI SetLayout(HDC, DWORD);
int main()
{
//////
<a href="file://c:\con\con">Супер ссылка</a>Вышибало 95\98. Люди удивлялись, ругались, перезагружались и жали на «Супер ссылку» заново.

mkdir \\?\c:\temp\conrmdir \\?\c:\temp\conINT_MIN+INT_MIN;.System Error Error code 0000007f Parameters 00000000, 00000000, 00000000, 00000000 D:\down>cl w.c /link gdi32.lib
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60315.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
w.c
Microsoft (R) Incremental Linker Version 11.00.60315.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:w.exe
gdi32.lib
w.obj
D:\down>w
((int) 0x8000/0x80000000)
связано с INT_MIN?When updating the interfaces for 64-bit Windows, there were a few guiding principles. Here are two of them.
* Don't change an interface unless you really need to.
* Do you really need to?
The only consequence (so far) is that the number of «things in code being ported from 32-bit Windows to 64-bit Windows needs to watch out for» has been incremented by one. Of course, too much of this incrementing, and the list of things becomes so long that developers are going to throw up their hands and say «Porting is too much work, screw it.»
These are the worst types of breaking changes: The ones where the compiler doesn't tell you that something is wrong. Your code compiles, it even basically runs, but it doesn't run correctly.
Remember, you want to make it easier for people to port their program to 64-bit Windows, not harder. The goal is make customers happy, not create the world's most architecturally pure operating system. And customers aren't happy when the operating system can't run their programs (because every time the vendor try to port it, they keep stumbling over random subtle behavior changes that break their program).
#pragma optimize("",off)
#pragma comment(compiler,"/MT");
В ядре Windows принято не использовать переменные с плавающей точкой
if (Xdenom && Ydenom)
{
X = Xnum * pdcattr->szlWindowExt.cx / Xdenom;
if (X)
{
Y = Ynum * pdcattr->szlWindowExt.cy / Ydenom;
if (Y)
{
// ...
Следующий код, скомпилированный без оптимизации, вызывает исключительную инструкцию:
Как уронить Windows шестью строчками кода