You are not logged in.
Pages: 1
So I am doing a compsci major at a local institute of technology. Obviously we get coding assignments regularly.
At home I am using Arch, compiling C projects using gcc. Today I have asked the TA's who are checking the homeworks what they use to compile our codes, and they said that they use Ubuntu and gcc. I have also asked the version but they don't know which they have installed.
Our teacher had said that while they check the assignments, they don't want to see any warnings/errors compiling. As far as I am concerned, some compilers might show a warning when others don't.
Long story short, can I rest assured that all my code, tested with gcc with the following version
gcc version 4.5.2 20110127 (prerelease) (GCC)
work on their Ubuntu machines without any warnings/errors?
Offline
If they don't want to see warnings or errors when compiling, then to be fair, they should tell you what flags they're compiling with (or provide them a Makefile). You can compile some really sloppy code without producing any warnings by omitting flags. Compiling with '-Wall -pedantic' will show significantly fewer warnings than....
-Wextra -Wempty-body -Wfloat-equal -Wignored-qualifiers -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wold-style-declaration -Woverride-init -Wsign-compare -Wstrict-prototypes -Wtype-limits -Wuninitialized -fstack-protector-all -D_FORTIFY_SOURCE=2
I'm doubtful that you'll hit some edge case where a warning changed between versions of gcc.
Offline
You can never be 100% sure without testing with the exact same compiler and compiler version, and to be really sure you should preferably test it on the same system (for example if it needs any external dependencies that may or may not be installed on their system).
Their version seems to be 4.5.1, so I highly doubt that you'll get any issues. Otoh, they didn't say which version of ubuntu they are using...
http://packages.ubuntu.com/sv/natty/gcc
On a project I'm doing atm I'm compiling with the -ansi flag, which I'm hoping will make it easier to port to *bsd, haiku, windows etc (just in case it ever reaches a state where there is a point in releasing it). However, with 2 very similar versions of gcc, that shouldn't matter at all.
Offline
Thanks for the replies.
@falconindy:
I don't think they would be using any flags, since they haven't told us about them (yet).
@scorpyn:
I think they use either Ubuntu 10.04 or 10.10. It seems maverick has gcc 4.4.4 (http://packages.ubuntu.com/maverick/gcc). Do you think there is difference between the two (4.5 and 4.4) enough for me to worry?
Offline
Tbh, I'm still a beginner, so I don't really know the differences between the compiler versions. You'd have to check the changelogs to find out.
I suppose there is a chance that you're trying to do something that isn't supported yet in the older version, but without even knowing what the exercise is about its impossible to find out if that's the case or not.
Try compiling with the -ansi flag. If that works, it should be ok. If not, my guess is that the code is probably ok anyway. You could also try installing freebsd in qemu or similar and compile it there as well, and if that also works I'd be VERY surprised if it doesn't work on their system.
Btw, don't they give you access to a test system for this purpose?
Offline
Unfortunately no, we aren't allowed to use their system, not even for testing purposes.
Oh well... I guess I will just install Ubuntu on Virtualbox and test it there before handing the papers in.
Offline
Pages: 1