Stream

Join this community to post or comment
 
Hello C friends! I'm looking for a book about building automated tests. I'm trying to push my project through travis-ci, but for now it is failing because lack of tests. I
already have Makefile.am's and configure.ac, but don't know how to create "make test" target ;) I wish to find some literature about it which answers my questions and help me in solving this problem ;)
1
Tim Ruehsen (rockdaboot)'s profile photo
3 comments
 
Also pick examples, e.g. in wget you find two test directories (tests/ with Perl tests and testenv/ with python tests), both test suites are executed by 'make check'.
There is also a .travis.yml that shows you how to integrate with TravisCI.
Add a comment...

Iron Bug

Libraries  - 
 
Library uthash updated:
https://github.com/troydhanson/uthash

Fixed bug in xxx_INORDER functions.

If you did not use them in your code. nothing threatens your programs. But updating is a good idea.
uthash - C macros for hash tables and more
2
Add a comment...

Andrey Karpov

Tutorials & Books  - 
Introduction. The reason for writing this article, was my report on the open conference ISPRAS OPEN 2016 that took place in the beginning of December, in the main building of the Russian Academy of Sciences. The subject of the report: "The operation principles of PVS-Studio static code analyzer" ...
2
Sean's Hobbies's profile photo
 
Lots good stuff inside that article
Add a comment...
 
Greetings, I am doing some self exploration with programming. I am not a collect student so I'll get that out of the way first.

I have written the functionality of several of the smaller gates. I started writting the more complex gates like the half adder and I ran into an issue. I'd like some feedback. The half adder returns two values. The sum and the carry. I know I can return one value. How can I handle the carry bit? below is my code. Please feel free to leave comments.
1
Martin Kühne's profile photoSean's Hobbies's profile photo
6 comments
 
When I get it working. I will post the whole thing up on Git. Right now I am just trying to build the gates and associated chips along with them. It's more of a learning experience than anything else.

I was able to figure everything out thanks to the guys name in characters up above.
Add a comment...

Iam Pyre

Anything  - 
 
Somewhat Off-Topic:

If you we're going to get a laptop-computer simply just to: compile code, manage administrative notes for projects(.docx, .txt), run project development related applications
What specifications would you require of that system? Let's exclude any features specs that would be overkill, and base your requirements strictly on accomplishing the tasks I mentioned above. Thank you.

#computing #coding #dev #research
2
Florian Philipp's profile photo
 
This may be a bit on the high end but I use my laptop almost purely for development and when I replace it, I will look for something with these requirements:

- decently high resolution display, maybe 1920xN with a good height. Probably not 4k as that is actually detrimental to the performance of some IDEs (looking at you, Eclipse)

- dedicated Nvidia GPU with double precision capabilities to develop and test OpenCL + CUDA applications. AMD won't cut it purely for compatibility reasons.

- at least 1 GiB RAM per CPU core, preferably 1.5 GiB. GCC compiling C++ code tends to consume almost 800 MiB per process. My current machine has 8 GiB and occasionally swaps on its SSD while compiling.

- a good keyboard with many special keys. Having page-up/down, pos1 and end easily reachable and maybe even the second Windows key (whatever it is called -- the one that opens the context menu) is a big bonus.

- good Linux support.

- pure CPU performance would not be a big issue but modern features like AVX2 or transactional memory extensions would be.
Add a comment...

Chris McClelland
owner

Anything  - 
52
6
Chris McClelland's profile photoMartin Kühne's profile photo
5 comments
 
+Chris McClelland​ my g+ intro seems to have been flawed. see comment: code/memory footprint. as for the speed, my money is on how smart each stdlib/os handles these call patterns, that could be any of the available implementations.
Add a comment...

Andrey Karpov

Announcements  - 
Since the release of the publicly available Linux-version of PVS-Studio, it was just a matter of time until we would recheck the Linux kernel. It is quite a challenge for any static code analyzer to check a project written by professionals from all around the world, used by people in various ...
8
Christopher Hanks (cjhanks)'s profile photo
 
The image is fairly disturbing and confusing.
Add a comment...
 
We have migrated our time series database from Python to native C, why did we do this and what is the effect?
http://siridb.net/blog/migrating-a-tsdb/
With the upcoming release of our time series database as an open source database we’d like to reveal a bit more about the process. SiriDB migrated from Python to native C.
6
Add a comment...

Andrey Karpov

Announcements  - 
4
Andrey Karpov's profile photoMartin Kühne's profile photo
3 comments
 
+Andrey Karpov so my version is already too old. keep up the great work.
Add a comment...

About this community

A community of C Programming Language lovers. Feel free to share your projects with everyone. Sharing relevant links is OK, provided you give a short explanation of why it's interesting, and provided the target page is not an ad-infested mess. If you're posting code, please ensure it's properly formatted. If G+ ruins your formatting, paste your code to pastebin.mozilla.org and edit your post to include the pastebin link. Do not post images of code, because they cannot be copy/pasted in any useful way. Please don't post about Turbo C (try https://plus.google.com/u/0/communities/107762151066802521360), and please ensure you enable comments on your posts: this is a community, not a captive audience! Be careful about cross-posting to several communities: if you consistently cross-post to many communities without any other more meaningful interaction here you run the risk of being classified as a spammer and banned. Finally, if you're a new member, your initial posts will be moderated to ensure they're on-topic.

Nastya Zubkova

Tutorials & Books  - 
 
How PVS-Studio does the bug search: methods and technologies

PVS-Studio is a static #code analyzer, that searches for errors and vulnerabilities in #programs written in C, C++ and C#. In this article, I am going to uncover the technologies that we use in #pvsstudio analyzer. In addition to the general theoretical information, I will show practical examples of how certain technology allows the detection of #bugs.

#programming #cpp #dev #staticcodeanalyzer

Would you like to learn more about the PVS-Studio static code analyzer? Contact me - nz@pvs-studio.com

Introduction. The reason for writing this article, was my report on the open conference ISPRAS OPEN 2016 that took place in the beginning of December, in the main building of the Russian Academy of Sciences. The subject of the report: "The operation principles of PVS-Studio static code analyzer" ...
1
Add a comment...
 
Hi. I'm an electronic engineering student interested in low level programming with C. I have learnt C basics, but I wish to understand C to the point of having full control of the hardware (like forcing the disk tray to open, or the speaker to beep, etc). Please advise on the path to take, and the things to learn along the way. Thanks.
3
Add a comment...
7 comments
 
I think I might be having a brain fart. Cause for some reason my brain won't let me get past the fact I should be able to take a pointer fill it like an array and then pass the pointer from a function. In the example below I have stored int's from a struct passing into an array I need to return the outside wold.

I need to be able to pass 9 seperate values out.
2
Leonard König's profile photoSean's Hobbies's profile photo
9 comments
 
I am good. I am doing a learning experiment not so much worried about who takes credit for the compile or what confusing things go on in the background. I'll check out the compiled assembly later on and see if VS actually put any junk in I don't want for now I am going to keep moving forward.
Add a comment...
 
This program from gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/20021127-1.c

/* { dg-options "-std=c99" } */

long long a = -1;
long long llabs (long long);
void abort (void);
int
main()
{
if (llabs (a) != 1)
abort ();
return 0;
}
long long llabs (long long b)
{
abort ();
}

executes the `return 0` statement in main. Can someone please enlighten me why the function llabs is not called, which would mean the (no return) statement abort() in llabs would be executed instead? TIA

I've looked at the assembler using GDB and it looks like the argument to llabs is actually evaluated, then there's even a comparison of rax to the constant 1, but there's no call to llabs (even with -O0).

(gcc 5.4.0, ubuntu mate 16.10/64bit)

edit: G+ hates formatted source code (tabs were replaced by spaces), the collapse to the left margin is not my fault :-(
1
Chris McClelland's profile photoJan Mercl's profile photo
12 comments
 
I think the point of the test is to guard against a regression in the existing gcc behavior, which per se is a good thing - regardless of that very behavior being problematic from the standard's POV.
Add a comment...

Andrey Karpov

Announcements  - 
Background. Me (Andrey Karpov) and Evgeniy Ryzhkov worked in a small company in Tula, which was working on the creation of numerical simulation packages and data visualization. This job was rather interesting and we could use and get in touch with the cutting-edge technologies of that time.
7
Martin Kühne's profile photoPeter D'Hoye (petur)'s profile photo
2 comments
 
A lot of the issues mentioned are not 64bit specific, in fact they are basic stuff when writing code on microcontrollers where your variables may be 8, 16 or 32 bit. 
Add a comment...

Álvaro Jurado

Announcements  - 
 
 
Harvey, the GPL'ed fork of Plan 9, now runs on the RISCV SPIKE emulator. I'll be trying the lowrisc FPGA bitstream soon. Harvey is C11 compliant and does not use the old Plan 9 C toolchain. We've shown that we can build a working kernel on x86-64 with gcc 4, 5, and 6; and clang 3.5, 3.6 and 3.8. We're looking forward to seeing how Harvey works with the forthcoming RISCV clang port. Both gcc and clang uncovered bugs that had been in the codebase for many years.

We can always use more contributors. For more, see harvey-os.org.

A distributed operating system. Harvey is an effort to provide a modern, distributed, 64 bit operating system. A different environment for researching and finding new lines of work. It can be built with gcc and clang and has an ANSI/POSIX compliant subsystem.
9
1
Álvaro Jurado's profile photopixel fairy's profile photo
4 comments
 
that logos awsome!
Add a comment...
 
We're doing an OS in harvey-os.org. Recently we are researching for a new memory handling model for replacing or implementing actual one, based on Plan 9 4th ed. It requieres understanding actual and some good hacking skill.
Also, building gcc with ansi/posix environment based on musl libc (called apex), we found troubles with signaling in mksh and bash. The cross-native compiler is ready (with harcoded paths due to autoconf). Every hand is welcome to bring up an stable small server with features like resource sharing and everything as a file. More info about how to contact us and the code, status, tasks etc... in our website. We didn't begin to collecting donatives yet so this is just for love for now :-). Maybe soon we could gift some compensation for the efforts. Anyone interested in jumping to the sand? Thanks!
A distributed operating system. Harvey is an effort to provide a modern, distributed, 64 bit operating system. A different environment for researching and finding new lines of work. It can be built with gcc and clang and has an ANSI/POSIX compliant subsystem.
11
Add a comment...

Xmec00X _

Anything  - 
 
Hi guys
I need help. I own two pcs at home , one with windows 7, and one with linux mint sarah. I can't understand why on the windows one, the string system("...") works regularly, while on the Linux mint One it doesn't at all. I have a theory... I think that, for example, CLS is a DOS command and not a Linux terminal one; in that case, is there a way to, for example, do the CLS on Linux?
Sorry for bad english
3
Mohan Pathak's profile photo
8 comments
 
I cannot advice on system - related issues but if you wish to clear the screen in a Linux terminal you just have to press control+l (L) or use the 'clear' command.
Add a comment...

Nazar Kos

Anything  - 
 
only on C
Read from the keyboard three integers and bring more of them.
In case of equal output any.
This problem can be solved without arrays, loops, and functions.

pls help
thanks


int main() {
int num1, num2, num3, max;

scanf("%d %d %d", &num1, &num2, &num3);

if ( num1 > num2 ) {
max = num1;
printf("%d\n", num1);
} else if ( max == num2 ) {
printf("%d\n", num2);
} else if ( num3 > max ) {
printf("%d\n", num3);
} else {
num1 = num2 = num3;
printf("%d\n", num1 );
}
return 0;
}


my code dont works
1
Mathias Hablützel's profile photo
2 comments
 
Is it homework season again?
Add a comment...
 
I agree with +Pierre Jackson's comments and would add a few things.

Tiobe is not Scientific. The lack of searching may mean more about the quality of the resources available than the popularity of the language.
 
C programming language showing signs of weakening in 2016

Plummeting from second place... to second place.

http://betanews.com/2016/11/30/c-programming-language-showing-signs-of-weakening-in-2016/
Created in 1972 by Dennis Ritchie, C is a dinosaur among computing languages. It’s large, powerful, and has dominated the programming ecosystem for over three decades. Technology changes every few years, and today there are hundreds of programming languages. It’s remarkable that one language has been able to remain so popular over the years, and there’s a reason for that.
6
3
Jerry Babione's profile photoGuido Stepken's profile photo
23 comments
 
C is kind of portable assembler. It never goes away, such as Linux.
Add a comment...

Chris McClelland
owner

Announcements  - 
 
G+ added a new "community" feature: hold posts by new members for moderation. I have enabled this option on our community.
13
Martin Kühne's profile photoDavid Armstrong's profile photo
2 comments
 
Sounds like a good feature. One of the other communities I'm following has turned into a porno site. This feature could prevent that. Thanks for enabling that!
Add a comment...