ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Slava Semushin" <slava.semushin@gmail.com>
To: "ALT Devel discussion list" <devel@lists.altlinux.org>
Subject: Re: [devel] timestamp
Date: Thu, 30 Aug 2007 12:59:52 +0700
Message-ID: <75e139a00708292259t36a862d0ud9061925b5fbbdc9@mail.gmail.com> (raw)
In-Reply-To: <200708300937.56749@ruslandh>

2007/8/30, Хихин Руслан <hihin / yandex.ru>:
[...]
> In file included from callbacks.c:31:
> /usr/include/linux/videodev2.h:352: ошибка: поле 'timestamp' имеет
> неполный тип
[...]
> PS Насколько я понимаю timestamp - это структура представления времени.
> Как  она может быть не полностью определена не понимаю. Может
> какой-нибудь хеадер надо добавить ?

[c0der@rock ~]$ cat video-test.c
                                    12:54
#include <linux/videodev2.h>

int main(void) {

 return 0;
}

[c0der@rock ~]$ gcc video-test.c -o video-test
                                    12:54
In file included from video-test.c:1:
/usr/include/linux/videodev2.h:225: ошибка: expected
specifier-qualifier-list before '__s32'
/usr/include/linux/videodev2.h:232: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:241: ошибка: expected
specifier-qualifier-list before '__u8'
/usr/include/linux/videodev2.h:275: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:335: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:351: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:393: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:428: ошибка: expected
specifier-qualifier-list before '__u16'
/usr/include/linux/videodev2.h:475: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:499: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:507: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:542: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:569: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:581: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:594: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:622: ошибка: expected '=', ',', ';',
'asm' or '__attribute__' before 'v4l2_std_id'
/usr/include/linux/videodev2.h:704: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:718: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:755: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:773: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:780: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:794: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:840: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:855: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:889: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:900: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:915: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:932: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:956: ошибка: expected
specifier-qualifier-list before '__u16'
/usr/include/linux/videodev2.h:982: ошибка: expected
specifier-qualifier-list before '__u16'
/usr/include/linux/videodev2.h:993: ошибка: expected
specifier-qualifier-list before '__u32'
/usr/include/linux/videodev2.h:1018: ошибка: expected
specifier-qualifier-list before '__u8'
/usr/include/linux/videodev2.h:1032: ошибка: expected
specifier-qualifier-list before '__u8'
[c1der@rock ~]$

Что ж... попробуем добавить хедер asm/types.h перед включением
linux/videodev2.h (как это сделано в вашей программе):

[c0der@rock ~]$ gcc video-test.c -o video-test
In file included from video-test.c:2:
/usr/include/linux/videodev2.h:512: ошибка: поле 'timestamp' имеет неполный тип

А вот и ваша ошибка...

Структура timeval определена в файла sys/time.h (как написано в
setitimer(3)). Попробуем добавить этот хедер:

[c0der@rock ~]$ cat video-test.c
#include <asm/types.h>
#include <sys/time.h>
#include <linux/videodev2.h>

int main(void) {

 return 0;
}

[c0der@rock ~]$ gcc video-test.c -o video-test
[c0der@rock ~]$

Вывод: хедер linux/videodev2.h использует структуры из других хедеров,
но их не подключает. Это баг. Можно повесить даже в багзиллу с
приведёнными тест-кейсами.

Workaround: добавить подключение sys/time.h вручную.

-- 
+ Slava Semushin | slava.semushin @ gmail.com
+ ALT Linux Team | php-coder @ altlinux.ru

      reply	other threads:[~2007-08-30  5:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30  5:37 Хихин Руслан
2007-08-30  5:59 ` Slava Semushin [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=75e139a00708292259t36a862d0ud9061925b5fbbdc9@mail.gmail.com \
    --to=slava.semushin@gmail.com \
    --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