An warring generated by the GCC

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • friendfish

    An warring generated by the GCC

    Anyone can told me about the warrning which GCC generated as following:
    "No newline at end of file"?
  • fnegroni

    #2
    Re: An warring generated by the GCC

    On May 7, 7:47 pm, friendfish <friendf...@gma il.comwrote:
    Anyone can told me about the warrning which GCC generated as following:
    "No newline at end of file"?
    By convention, in a Unix "text" file, all lines are terminated by the
    newline character.
    Most Unix text editors respect this convention.
    gcc is warning you that the file is not conforming to the convention,
    which means the last line might have been truncated and therefore you
    should look into that as it is a potential problem.

    Comment

    • Peter Nilsson

      #3
      Re: An warring generated by the GCC

      fnegroni wrote:
      On May 7, 7:47�pm, friendfish <friendf...@gma il.comwrote:
      Anyone can told me about the warrning which GCC generated as
      following: "No newline at end of file"?
      >
      By convention, in a Unix "text" file, all lines are terminated by the
      newline character.
      Most Unix text editors respect this convention.
      gcc is warning you that the file is not conforming to the convention,
      which means the last line might have been truncated and therefore
      you should look into that as it is a potential problem.
      <http://groups.google.com/group/comp.lang.c/search?
      group=comp.lang .c&q=No+newline +at+end+of+file >

      --
      Peter

      Comment

      • Jack Klein

        #4
        Re: An warring generated by the GCC

        On Thu, 08 May 2008 10:47:57 +0800, friendfish <friendfish@gma il.com>
        wrote in comp.lang.c:
        Anyone can told me about the warrning which GCC generated as following:
        "No newline at end of file"?
        The C standard states that "a source file that is non-empty shall end
        in a new-line character" and your source file doesn't. So add one.

        Open the source file in a text editor. Move the cursor to the end of
        the last line, after the last character. Press the "Enter" key on
        your keyboard. Save the file.

        --
        Jack Klein
        Home: http://JK-Technology.Com
        FAQs for
        comp.lang.c http://c-faq.com/
        comp.lang.c++ http://www.parashift.com/c++-faq-lite/
        alt.comp.lang.l earn.c-c++

        Comment

        • CBFalconer

          #5
          Re: An warring generated by the GCC

          friendfish wrote:
          >
          Anyone can told me about the warrning which GCC generated as following:
          "No newline at end of file"?
          It means that there is "No newline at end of file". What's the
          problem? Is it so hard to add it?

          --
          [mail]: Chuck F (cbfalconer at maineline dot net)
          [page]: <http://cbfalconer.home .att.net>
          Try the download section.


          ** Posted from http://www.teranews.com **

          Comment

          Working...