confusing messages from clang
Alex Denisov
1101.debian at gmail.com
Sat Feb 20 07:33:21 UTC 2016
Hi Steve,
I’ve submitted the bug to LLVM’s bugzilla: https://llvm.org/bugs/show_bug.cgi?id=26678
Also, it looks like OS agnostic. At least I see the same behaviour on OSX as well.
--
AlexDenisov
Software Engineer, http://lowlevelbits.org
> On 20 Feb 2016, at 01:57, Steve Kargl <sgk at troutmask.apl.washington.edu> wrote:
>
> If anyone is interesting fixing FreeBSD's C compiler, it
> would be appreciated.
>
> % cat foo.c
> #include <stdio.h>
> #include <unistd.h>
>
> void
> foo(int i)
> {
> if (i < 0)
> goto whoops;
>
> if (i == 0)
> printf("foo\n");
>
> if (i > 0)
> goto corrupt;
> return;
>
> whoops:
> printf("whoops\n");
> return
>
> corrupt:
> printf("corrupt\n");
> }
>
> % cc -c foo.c
> foo.c:21:1: error: use of undeclared identifier 'corrupt'; did you mean 'crypt'?
> corrupt:
> ^~~~~~~
> crypt
> /usr/include/unistd.h:450:7: note: 'crypt' declared here
> char *crypt(const char *, const char *);
> ^
> foo.c:21:8: error: expected ';' after return statement
> corrupt:
> ^
> ;
> foo.c:14:12: error: use of undeclared label 'corrupt'
> goto corrupt;
> ^
> 3 errors generated.
>
>
> No, I did not mean crypt. 'corrupt' is a defined label.
> The missing semicolon occurs in line 19, but the line is
> not properly identified in error output.
>
> --
> Steve
> _______________________________________________
> freebsd-toolchain at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
> To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20160220/eb74583a/attachment.sig>
More information about the freebsd-toolchain
mailing list