![]() |
Why is it that gcc give a warning?
Why is it that gcc (and perhaps other compilers) give you a warning if you don't have a blank line at the end of a source file?
|
because the blank line makes it all work.
|
The reason is that you don't have the right linebreak... some windows programs makes the wrong linebreak charcode.. if you have ever opened a document in Notepad or similar and everything in the document is on a single line with black boxes in between the words, that's the correct type of linebreak that shuts up gcc.exe
|
thank you, pulse. no .exe here ;)
|
Or gcc for other platforms ;)
|
Quote:
The real reason is that it's conventional to have a blank line at the end of a program source. When most programmers do it and you have a file without the blank line, it's probable that the file was not downloaded completely, or truncated at the wrong position, etc.. gcc is just being nice by reminding you to double-check the file for completeness. |
I've tried it, I used notepad for coding.. whining, and I put a "black box" from another document in at the end of the line.. (I did have a line at the end before too), and voilà, no whine.
There are different linebreaks, wordpad converts the ones that notepad don't but I think wordpad makes the same linebreaks as notepad if you press enter... meaning, you get the same whine using wordpad as notepad. |
kate or kwrite for me. I especially like kwrite because sometimes kate seems to use a lot of resources for a text editor.
|
My mum is not a text editor! :p
|
Now I use Blodshed Dev-C++ but early stages of regular ANSI C I used notepad...
|
I use jEdit, since I write many different languages (Java, Javascript, XUL, XBL, generic XML, Java, C, OCaml, Python and a couple of others) for various reasons, and screw getting a seperate IDE for each one. Also, jEdit is cross-platform, meaning I can use the same one on both Windows and Linux. Which is especially handy since I don't really like EMacs, and can't stand using Vim.
|
Pretty much every text editor in the world EXCEPT Notepad supports Unix text files.
|
Do Macs use UNIX text files in OS X? They used to use some other linebreak format...
|
I belive it's UNIX linebreaks that notepad don't understand. We're talking about win98 notepad here, not the one with XP cause that one is greately improved since win98.
|
It can get very confusing i think when you work on a file in something like kate and you get some lines that are particularly long. Then you open them in gedit or something similar and all of a sudden, word wrap is on!!! wtf?
|
Quote:
|
XP notepad also hates UNIX linebreaks.
|
It's an extremely basic text editor for Windows, it wows me that people think it's gonna deal with UNIX linebreaks...
|
name another text editor that doesnt then.
|
To convert a charcode isn't much hard work when it's ASCII... even I could make a code for that :P
When it's reading the datastream, everytime it stumbles across a UNIX linebreak, change the charcode to the appropriate one.. OR it could just read both as linebreaks... even saving the old ones as the old charcode..which would make a mess on another text editor that can't read both types... so there are some places where the line breaks and some places it fails.. maybe to much of a mezz when I think of it. |
Quote:
|
Well, since notepad have excisted since the dawn of windows... thinking of edit.com as it's ancestor, there would be a whole lot of wasted time to make such a program wouldn't it? The XP version can at least replace text, it alos have feedback on what line/char the marker is, and it can also save by <ctrl> + <s>
All these features didn't excist in the win3.1/95/98 version of notepad. Looking away from the fact that it can't convert/create UNIX linebreaks, Notepad clearly is the ASCII editor for the simple minded. Many ppl like it that way, and I can actually say I have used it for a lot of HTML and C. For C/C++ nowadays I use Dev-C++ and for everything else (like MAKI), I use Textpad 4 Evaluation which I got on a CD with one of my Java books. I like it very much, and the only thing I don't like it for, is the lack of coloring certain types of documents, like XML which I automatically set to HTML so I at least get attribute comments and < > filtered with colors. |
I know it's notepad, and susposed to be dead simple and not on top of Mircosoft's development list. But really, how hard would it be to add Unix file support.
|
How useful would it be? It's designed for taking notes. It would be trivial to add it, but it's support for the format of another OS -- why add it?
A thought though -- maybe services for UNIX adds support? |
Yeah, but it is also the default application for .TXT files. If you want to be the defualt for them you should support all of them.
|
And if you MUST convert the linebreaks, you can also use the wordpad.. which always have been able to convert linebreaks properly.. or write as it was named under win3x
|
i used to do essays for school in write!
|
<3 edit.com
|
Quote:
edlin.com anyone? |
Wow. I never even noticed that. I think I'm going to write my term paper in edit.com
On a side not. . . http://www.command.com |
No, Notepad doesn't decend from edit.com, but it's what microsoft replaced edit.com with for windows. I belive windows 1.0 still used Edit, but 3.1 you had both.
|
| All times are GMT. The time now is 14:29. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.