[vlc-devel] Re: Compiling with visual studio 2005

Mortisandraco scrawler at linuxwaves.com
Thu Dec 21 15:22:52 CET 2006


>> Currently I'm at the download limit of my provider so I 
>> can't download cygwin to check with gcc (--pedantic IIRC).

> I don't know if -pedantic will work. I know from experience that 
> switching from -std=gnu99 to -std=c99 removes all the non-ISO APIs, 
> which understandably does not work with VLC. It's a pity considering we 
> do not necessarily want to include non-standard GNU constructs. On the 
> other hand, I think we use some non-standard "__attribute__" when 
> compiling under GCC, and I don't know what happens if using -pedantic 
> or -std=c** either.

I haven't come across __attribute__ yet. But I did see several warnings telling that strdup() is deprecated and should use the iso c++ conformant name _strdup(). I've ignored it until now because they were just warnings and had no idea how you would feel towards changing it. I think if you change strdup(), strncmp(), etc.. you would be able to compile with -std=c99 (if you can't already).

About variable sized arrays from google-groups comp.lang.c++

[nan at xxx test]$ cat ary.c
int main()
{
        int size;
        int array[size];
        return 0;

}

[nan at xxx test]$ gcc  -pedantic ary.c
ary.c: In function `main':
ary.c:4: warning: ISO C89 forbids variable-size array `array' 

Maybe I can mail you libvlc (or a diff or whatever) to see what I changed and if it's acceptable.

>> I changed the code to char* array = malloc(i * sizeof(char));
> By the way, note that sizeof(char) == 1 per definition.

I know it was just an example.

_____________________________________________________________
Get your FREE, LinuxWaves.com Email Now! --> http://www.LinuxWaves.com
Join Linux Discussions! --> http://Community.LinuxWaves.com

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list