From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1994 invoked by alias); 20 Apr 2002 13:30:28 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 1974 invoked from network); 20 Apr 2002 13:30:23 -0000 Received: from unknown (HELO fepC.post.tele.dk) (195.41.46.147) by sources.redhat.com with SMTP; 20 Apr 2002 13:30:23 -0000 Received: from tdcadsl.dk ([80.62.84.198]) by fepC.post.tele.dk (InterMail vM.4.01.03.23 201-229-121-123-20010418) with ESMTP id <20020420133022.RSCX22769.fepC.post.tele.dk@tdcadsl.dk> for ; Sat, 20 Apr 2002 15:30:22 +0200 Message-ID: <3CC16CCC.208EE941@tdcadsl.dk> Date: Sat, 20 Apr 2002 06:56:00 -0000 From: bjorn rohde jensen Reply-To: shamus@tdcadsl.dk X-Accept-Language: en MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: Array Initialization warnings References: <3CC16A64.7060802@keyed-upsoftware.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00215.txt.bz2 Hi David, The compiler is quite right, your initialiser is for an int JPEG_MRK_NTSC[16]. Try something like; int JPEG_MRK_NTSC[4][4] = { {0x01, 0x02, 0x03, 0x04}, {0x05, 0x06, 0x07, 0x08}, {0x09, 0x0a, 0x0b, 0x0c}, {0x0d, 0x0e, 0x0f, 0x00} }; yours sincerely, bjorn David Stroupe wrote: > > When I compile this line of code > > int JPEG_MRK_NTSC[4][4] = > { > 0x01, 0x02, 0x03, 0x04, > 0x05, 0x06, 0x07, 0x08, > 0x09, 0x0a, 0x0b, 0x0c, > 0x0d, 0x0e, 0x0f, 0x00 > }; > > with the -Wall option, I get the following warnings > > vis.c:264: warning: missing braces around initializer > vis.c:264: warning: (near initialization for `JPEG_MRK_NTSC[0]') > > If I look at the values of the array members during execution, they are > correct. > > Is this array really being initialized correctly? > Are the warnings correct? > > Is there a way to 'turn off' these particular warnings with a compiler > directive? > > TIA > > -- > Best regards, > David Stroupe > Keyed-Up Software