PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > An warring generated by the GCC
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
An warring generated by the GCC

Réponse
 
LinkBack Outils de la discussion
Vieux 08/05/2008, 03h47   #1
friendfish
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut An warring generated by the GCC

Anyone can told me about the warrning which GCC generated as following:
"No newline at end of file"?
  Réponse avec citation
Vieux 08/05/2008, 03h55   #2
fnegroni
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: An warring generated by the GCC

On May 7, 7:47pm, friendfish <friendf...@gmail.com> wrote:
> 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.
  Réponse avec citation
Vieux 08/05/2008, 04h33   #3
Peter Nilsson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: An warring generated by the GCC

fnegroni wrote:
> On May 7, 7:47�pm, friendfish <friendf...@gmail.com> wrote:
> > 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
  Réponse avec citation
Vieux 08/05/2008, 04h49   #4
Jack Klein
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: An warring generated by the GCC

On Thu, 08 May 2008 10:47:57 +0800, friendfish <friendfish@gmail.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.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
  Réponse avec citation
Vieux 08/05/2008, 22h39   #5
CBFalconer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 **
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h44.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13818 seconds with 13 queries