From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26888 invoked by alias); 5 Aug 2011 16:59:52 -0000 Received: (qmail 26877 invoked by uid 22791); 5 Aug 2011 16:59:51 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Aug 2011 16:59:37 +0000 From: "rafe.kettler at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug manual/13058] New: Examples in glibc manual are inconsistent in declarations of main() X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: manual X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: rafe.kettler at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: roland at gnu dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 05 Aug 2011 16:59:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00005.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13058 Summary: Examples in glibc manual are inconsistent in declarations of main() Product: glibc Version: unspecified Status: NEW Severity: minor Priority: P2 Component: manual AssignedTo: roland@gnu.org ReportedBy: rafe.kettler@gmail.com Created attachment 5876 --> http://sourceware.org/bugzilla/attachment.cgi?id=5876 Patch for main() signatures in glibc manual. Generated by git diff Different examples in the manual use varying declarations for main(), some of which are outdated or non-standard. manual/examples/longopt.c uses a pre-standard declaration for main like so: int main(argc, argv) int argc; char **argv; manual/examples/strncat.c uses a main() with no return type declared: main() Those are the only examples that are blatantly anachronistic. There is one more inconsistency in manual/examples/subopt.c, however, which uses a a different style for declaring main than all of the other examples. subopt.c uses: int main(int argc, char *argv[]) while all of the other examples use: int main(int argc, char **argv) The former is inconsistent with the latter, and the latter is inconsistent with the GNU coding standards. Attached is a patch (generated by `git diff > main_signatures.patch` that changes the signature of every main() in the examples to be either: int main (void) or int main (int argc, char **argv) Thanks for your time. PS: if someone needs a different kind of patch, I'd be happy to generate a different kind of patch. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.