From: Andrey Rahmatullin <wrar-alt@mail.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] Исправление warnings. Нужна помощь
Date: Thu, 8 Dec 2005 22:24:22 +0500
Message-ID: <20051208172422.GC5724@wrars-comp.wrarsdomain> (raw)
In-Reply-To: <auto-000286382065@intranet.ru>
[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]
On Thu, Dec 08, 2005 at 04:49:19PM +0600, php-coder wrote:
> cpu_linux.c:63: warning: use of assignment suppression and length
> modifier together in scanf format
> is_linux26 = fscanf(fp, "%*s %*llu %*llu %*llu %*llu %*llu %*llu
> %llu", &softirq);
>
> Читают файл /proc/stat. Что здесь не правильно? (полагаю, что
> количество %X не совпадает с количеством переменных в fscanf ?)
Не, насколько я понял из printf(3), аргументы с * читаются, но не
присваиваются никуда (не знал о такой фишке). Почему его нельзя
использовать вместе с ll - не знаю.
> fscanf(fp, "%*s %llu %llu %llu %llu %llu %llu %llu",
> &user, &nice, &system, &idle, &iowait, &irq, &softirq);
> else
> fscanf(fp, "%*s %u %u %u %lu", &user, &nice, &system, &idle);
> ...
>
> Думаю, что надо привести во втором fscanf'e всё как в первом, т.е.
> %llu вместо %u.
Ну, видимо да.
> Ничего страшного при этом не произойдет?
Неа.
> Pixmap backdrop;
>
> switch (backlight) {
> case LIGHTON:
> backdrop = backdrop_on;
> x = 2;
> break;
> case LIGHTOFF:
> backdrop = backdrop_off;
> x = 0;
> break;
> }
Хмм, я на такое обычно забиваю и в своем коде тоже...
> Хочу добавить сюда defaults, только вот что туда написать? Точнее,
> не знаю каким значением инициализировать переменную backdrop ?
нуллом его, нуллом...
(привычка C# ;))
Не знаю.
--
WBR, wRAR (ALT Linux Team)
Powered by the ALT Linux fortune(8):
Я опять переделал rpm-build-perl. Согласно проведённому мной
исследованию, новая версия rpm-build-perl на 42% лучше предыдущей. :)
-- at in devel@
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-12-08 17:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-08 10:49 php-coder
2005-12-08 17:24 ` 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=20051208172422.GC5724@wrars-comp.wrarsdomain \
--to=wrar-alt@mail.ru \
--cc=devel@lists.altlinux.org \
/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 Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git