From: Andrey Rahmatullin <wrar@altlinux.ru>
To: community@altlinux.ru
Subject: Re: [Comm] warnings
Date: Mon, 28 Jun 2004 15:40:40 +0600
Message-ID: <20040628094040.GA8922@wrars-comp.wrarsdomain> (raw)
In-Reply-To: <44656324.20040628161020@ngs.ru>
[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]
On Mon, Jun 28, 2004 at 04:10:20PM +0700, php-coder wrote:
> Извниняюсь, что пишу сюда, но больше не знаю где спросить.
Это Ваша прога или чужая? Еслм чужая, но компилится и работает -
нормально.
> functions.inc.h:100: warning: implicit declaration of function `getline'
> 100 getline(&buff_pointer, &buff_length, stdin);
Ф-я getline объявлена в файле stdio.h, но этот файл не включен в текущий
исходник. Допишите в него #include <stdio.h>
> functions.inc.h:109: warning: assignment makes integer from pointer without a cast
> 109 tracks_names_array[i] = buff_pointer;
> 118 tracks_names_array[i] = NULL;
Гм. tracks_names_array имеет тип char*, тогда tracks_names_array[i] имеет
тип char. Но ему присваивается значение типа "указатель" (неважно на что).
Это очень странно.
> main.c:39: warning: pointer targets in passing arg 1 of `strlen' differ in signedness
> 39 printf("Вы ввели: %s\nДлина строки: %d\n", tracks_names_array[i], strlen(tracks_names_array[i]));
В совокупности c предыдущим варнингом всё понятно. tracks_names_array -
это массив символов (его тип - char*), т.е. строка. Но по задумке это
массив строк, так? Это видно, в частности из того, что
tracks_names_array[i] по задумке явно строка (ей присваивается
значение-указатель, и от нее берется strlen).
Тогда tracks_names_array надо объявить как char**.
--
WBR, wRAR (ALT Linux Team)
> Прошу maintainer'ов принять меры.
> QA Robot вам об этом обязательно скоро напомнит. :)
Только не надо угроз :-)
-- mike in devel@
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2004-06-28 9:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-28 9:10 php-coder
2004-06-28 9:27 ` Yakov Bezrukov
2004-06-28 9:36 ` Re[2]: " php-coder
2004-06-28 9:45 ` Yakov Bezrukov
2004-06-28 10:25 ` Re[2]: " php-coder
2004-06-28 11:05 ` Yakov Bezrukov
2004-06-29 4:00 ` Re[2]: " php-coder
2004-06-28 9:30 ` php-coder
2004-06-28 10:51 ` Andrey Rahmatullin
2004-06-29 3:50 ` Re[2]: " php-coder
2004-06-28 9:40 ` Andrey Rahmatullin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040628094040.GA8922@wrars-comp.wrarsdomain \
--to=wrar@altlinux.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git