🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1684

Incorrect warning about incompatible arguments

#1684
From: Peter Montgomery
Date: Thu, 22 Sep 1988 04:11
17 lines
950 bytes
/*
        On a SUN 3 at OS 4.0, GCC 1.28 warns "argument passing between
incompatible pointer types" for the call to mat_print.  The warning does
not appear if "const" is omitted from the declaration of mat_print.  GCC
1.26 did not give this warning.  The object code is correct, with or
without optimization.
*/

void mat_print(const int mat[2][2]) {
    printf("Matrix elements are %d %d %d %d\n", mat[0][0], mat[0][1],
						mat[1][0], mat[1][1]);
}
main()
{
    int a[2][2] = {10, 20, 30, 40};
    mat_print(a);
}
Technical Details
Message-ID: <8809220411.AA01379@check.sm.unisys.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!osu-cis!tut.cis.ohio-state.edu!SM.UNISYS.COM!pmontgom

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!osu-cis!tut.cis.ohio-state.edu!SM.UNISYS.COM!pmontgom
From: pmontgom@SM.UNISYS.COM (Peter Montgomery)
Newsgroups: gnu.gcc.bug
Subject: Incorrect warning about incompatible arguments
Message-ID: <8809220411.AA01379@check.sm.unisys.com>
Date: 22 Sep 88 04:11:01 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 16